:root {
  color-scheme: dark;

  /* Engim-inspired blue palette */
  --bg: #01499a;
  --surface: #003d82;
  --surface-soft: #015bbd;
  --text: #ffffff;
  --muted: #d8e6f7;
  --accent: #ffcf3a;
  --accent-2: #9ae6ff;
  --border: rgba(255, 255, 255, 0.25);

  --focus: 0 0 0 3px rgba(255, 255, 255, 0.9);

  --radius: 14px;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.35);

  --max: 68rem;

  --step--1: clamp(0.95rem, 0.90rem + 0.3vw, 1.05rem);
  --step-0: clamp(1.1rem, 1.00rem + 0.55vw, 1.35rem);
  --step-1: clamp(1.35rem, 1.15rem + 1.1vw, 1.9rem);
  --step-2: clamp(1.75rem, 1.35rem + 2.2vw, 2.6rem);
  --step-3: clamp(2.1rem, 1.55rem + 3.2vw, 3.2rem);

  --space-1: 0.75rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: var(--step-0);
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 999;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  background: var(--accent);
  color: #002147;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
  outline: none;
  box-shadow: var(--focus);
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: #fff2a6;
}

a:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 0.35rem;
}

/* --- HEADER E LOGHI --- */
.site-header {
  background-color: #ffffff;
  padding: 1rem 0;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.header-logos-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.logo-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
}

.center-logo {
  justify-content: center;
}

.right-logo {
  justify-content: flex-end;
}

.partner-logo {
  height: 45px; 
  width: auto;
  display: block;
}

.site-logo {
  height: 75px; 
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.site-nav a {
  font-weight: 750;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1rem;
  border-radius: 0.9rem;
  background: var(--accent);
  color: #002147;
  text-decoration: none;
  font-weight: 900;
  border: 2px solid transparent;
  min-height: 44px;
}

.button:hover {
  filter: brightness(1.04);
}

.button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.button--ghost {
  background: transparent;
  border-color: var(--accent);
  color: var(--text);
}

.site-main {
  display: block;
}

.hero {
  padding-block: var(--space-5);
}

.hero-grid {
  display: grid;
  gap: var(--space-4);
  align-items: start;
}

h1 {
  font-size: var(--step-3);
  line-height: 1.15;
  margin: 0 0 var(--space-2);
}

h2 {
  font-size: var(--step-2);
  line-height: 1.2;
  margin: 0 0 var(--space-2);
}

h3 {
  font-size: var(--step-1);
  line-height: 1.25;
  margin: 0 0 0.35rem;
}

p {
  margin: 0 0 var(--space-2);
}

.lead {
  font-size: var(--step-1);
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.note {
  font-size: var(--step--1);
  color: var(--muted);
}

/* --- HERO CARD E QR CODE --- */
.hero-card {
  margin: 0;
  padding: 2.5rem 2rem;
  border-radius: var(--radius);
  background-color: #ffffff;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-card a {
  display: block;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.hero-card a:hover {
  transform: scale(1.05);
}

.qr {
  width: 200px;
  height: 200px;
  object-fit: contain;
  display: block;
  border-radius: 0;
  border: none;
  background: none;
}

.caption {
  margin-top: 1.5rem;
  color: #4a5568;
  font-size: var(--step--1);
  text-align: center;
  font-weight: 600;
  line-height: 1.4;
}

.section {
  padding-block: var(--space-5);
  border-top: 1px solid var(--border);
}

.section--alt {
  background: rgba(0, 61, 130, 0.6);
}

.language-grid {
  margin-top: var(--space-3);
  display: grid;
  gap: var(--space-2);
}

.language-card {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.9rem;
  background: linear-gradient(135deg, #015bbd, #003d82);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  text-align: left;
  transition:
    transform 0.12s ease-out,
    box-shadow 0.12s ease-out,
    background 0.12s ease-out;
}

.language-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6);
  background: linear-gradient(135deg, #0468d6, #003d82);
}

.language-card:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.language-icon {
  font-size: 1.7rem;
}

.language-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.language-name {
  font-size: var(--step-1);
}

.language-code {
  font-size: var(--step--1);
  opacity: 0.9;
}

.steps {
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-2);
}

.step {
  padding: var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0, 61, 130, 0.7);
}

.step p {
  color: var(--muted);
  margin: 0;
}

.bullets {
  margin: var(--space-2) 0 0;
  padding-left: 1.25rem;
}

.bullets li {
  margin-bottom: 0.75rem;
  color: var(--muted);
}

.bullets strong {
  color: var(--text);
}

.video-frame {
  margin-bottom: var(--space-4);
}

.video-inner {
  position: relative;
  width: 100%;
  border-radius: 1.1rem;
  overflow: hidden;
  background: #002147;
  box-shadow: var(--shadow);
}

.video-inner::before {
  content: "";
  display: block;
  padding-top: 56.25%;
}

.video-inner iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.course-content {
  max-width: 52rem;
}

.course-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
}

.course-heading-row h1 {
  margin: 0;
}

.tts-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: 0.9rem;
  border: 2px solid transparent;
  background: var(--accent);
  color: #002147;
  font-weight: 900;
  cursor: pointer;
  min-height: 44px;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.tts-button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.tts-button--active {
  filter: brightness(0.98);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25), 0 16px 30px rgba(0, 0, 0, 0.5);
}

.tts-button-icon {
  font-size: 1.2rem;
}

.tts-button-text {
  font-size: var(--step--1);
}

.course-overview {
  margin-bottom: var(--space-3);
  color: var(--muted);
}

.course-list {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
}

.course-list li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.9rem;
}

.course-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
  background: var(--accent-2);
  color: #002147;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 900;
}

.course-list--compact li {
  margin-bottom: 0.5rem;
}

.course-section {
  margin-top: var(--space-4);
}

.skills-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: var(--space-2);
}

.skill-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(154, 230, 255, 0.16);
  color: var(--accent-2);
  font-size: var(--step--1);
  border: 1px solid rgba(154, 230, 255, 0.7);
}

.course-actions {
  margin-top: var(--space-4);
}

body[dir="rtl"] .language-card {
  text-align: right;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

body[dir="rtl"] .course-list li {
  padding-right: 2rem;
  padding-left: 0;
}

body[dir="rtl"] .course-list li::before {
  right: 0;
  left: auto;
}

body[dir="rtl"] .course-heading-row {
  flex-direction: row-reverse;
  text-align: right;
}

body[dir="rtl"] .tts-button {
  flex-direction: row-reverse;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-3);
}

.small {
  font-size: var(--step--1);
  color: var(--muted);
  margin: 0;
}

/* --- ABOUT SECTION --- */
/* --- ABOUT SECTION (Video full-width, testo sotto) --- */
.about-container {
  max-width: 52rem; /* Limita la larghezza per non far diventare il testo illeggibile sui monitor grandi */
  margin-inline: auto;
}

.about-title {
  text-align: center; /* Centra il titolo */
  margin-bottom: var(--space-4);
}

.about-video {
  width: 100%;
  margin-bottom: var(--space-4); /* Spazio tra il video e il testo */
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2); /* Una bella ombra per far risaltare il video */
  border-radius: 1.1rem;
}

.about-content {
  text-align: left; /* Testo allineato a sinistra per massima leggibilità */
}

.about-content p {
  color: var(--muted);
  margin-bottom: 1.2rem;
  font-size: 1.1rem; /* Leggermente più grande per facilitare la lettura */
}

.about-content strong {
  color: var(--text);
}

/* --- FOOTER & SOCIALS --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-3);
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

/* Effetto hover: diventa giallo e si ingrandisce leggermente */
.social-link:hover {
  color: var(--accent);
  transform: scale(1.1);
}

.instagram-icon {
  width: 28px;
  height: 28px;
}

@media (min-width: 48rem) {
  .hero-grid {
    grid-template-columns: 1.25fr 0.75fr;
    align-items: center;
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .language-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-grid {
    grid-template-columns: 1fr 1fr; /* Divide lo spazio a metà: 50% video, 50% testo */
  }

  .footer-container {
    flex-direction: row; /* Su PC mette testo a sinistra e icona a destra */
    justify-content: space-between;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}