/* ═══════════════════════════════════════════════════════════════
   Vision-Aid AI Academy — Design System
   Brand-aligned with visionaid.org
   WCAG 2.1 AAA target (7:1 contrast on body text)
   ═══════════════════════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  /* Brand palette — derived from visionaid.org */
  --va-navy:       #0D2137;
  --va-navy-mid:   #152D45;
  --va-blue:       #1A6FB5;
  --va-blue-light: #2B8FD4;
  --va-teal:       #17A2B8;
  --va-gold:       #E8A838;
  --va-gold-light: #F5C563;
  --va-green:      #16A34A;
  --va-red:        #DC2626;
  --va-orange:     #D97706;

  /* Surfaces */
  --bg:            #F7F9FC;
  --bg-warm:       #FAFBFE;
  --surface:       #FFFFFF;
  --surface-hover: #F0F4FA;
  --surface-alt:   #EDF2F7;

  /* Text — all pass 7:1+ on --bg and --surface */
  --text:          #1A202C;
  --text-secondary:#4A5568;
  --text-muted:    #64748B;
  --text-on-dark:  #F7FAFC;
  --text-on-brand: #FFFFFF;

  /* Borders */
  --border:        #E2E8F0;
  --border-strong: #CBD5E0;

  /* Focus — high visibility gold */
  --focus-ring:    #D69E2E;
  --focus-bg:      rgba(214,158,46,0.12);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 28px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(13,33,55,0.06), 0 1px 2px rgba(13,33,55,0.04);
  --shadow-md: 0 4px 12px rgba(13,33,55,0.08), 0 2px 4px rgba(13,33,55,0.04);
  --shadow-lg: 0 12px 32px rgba(13,33,55,0.12), 0 4px 8px rgba(13,33,55,0.06);
  --shadow-xl: 0 20px 48px rgba(13,33,55,0.16), 0 8px 16px rgba(13,33,55,0.08);

  /* Typography */
  --font-body:    'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 150ms;
  --t-med:  250ms;
  --t-slow: 400ms;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
img { max-width: 100%; height: auto; display: block; }

/* ── Base Typography ── */
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.25;
  color: var(--va-navy);
}

a {
  color: var(--va-blue);
  text-decoration-skip-ink: auto;
  transition: color var(--t-fast) var(--ease);
}
a:hover { color: var(--va-blue-light); }

/* ── Accessibility ── */

/* Focus indicators — gold ring, visible on all backgrounds */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}
/* Extra visible for buttons */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--focus-bg);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  background: var(--va-gold);
  color: var(--va-navy);
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 16px;
  z-index: 10000;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
}
.skip-link:focus { left: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ── Header ── */
.site-header {
  background: var(--va-navy);
  color: var(--text-on-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.brand:hover { opacity: 0.92; }

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  padding: 3px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.3px;
  color: #fff;
}
.brand-sub {
  font-size: 14px;
  font-weight: 500;
  color: var(--va-gold-light);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-user {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}
.nav-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,0.2);
  transition: all var(--t-fast) var(--ease);
}
.nav-link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}

/* ── Flash Messages ── */
.flash-area {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px 0;
}
.flash-msg {
  padding: 14px 20px;
  border-radius: var(--r-md);
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 500;
}
.flash-error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}
.flash-message, .flash-success {
  background: #F0FDF4;
  color: #166534;
  border: 1px solid #BBF7D0;
}

/* ═══════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════ */
.login-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 72px);
}

.login-hero {
  background: linear-gradient(145deg, var(--va-navy) 0%, var(--va-navy-mid) 60%, #1A4A70 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

/* Subtle decorative circles */
.login-hero::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.06);
  top: -100px; right: -80px;
}
.login-hero::after {
  content: '';
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.04);
  bottom: -60px; left: -40px;
}

.login-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 420px;
}

.hero-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin: 0 auto 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  padding: 8px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 38px;
  color: #fff;
  margin: 0 0 6px;
  line-height: 1.2;
}
.hero-accent {
  color: var(--va-gold-light);
  display: block;
  font-size: 32px;
}
.hero-tagline {
  color: rgba(255,255,255,0.85);
  font-size: 18px;
  margin: 20px 0 10px;
  line-height: 1.5;
}
.hero-sub {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
  margin: 0;
}
.hero-mission {
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  margin-top: 32px;
  line-height: 1.6;
  font-style: italic;
}

.login-form-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--bg-warm);
}

.login-card {
  width: 100%;
  max-width: 420px;
}

.login-heading {
  font-size: 28px;
  margin: 0 0 8px;
}
.login-hint {
  color: var(--text-muted);
  margin: 0 0 32px;
  font-size: 15px;
}

.login-form { display: flex; flex-direction: column; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}
.form-group input {
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.form-group input::placeholder { color: var(--text-muted); }
.form-group input:hover { border-color: var(--border-strong); }
.form-group input:focus {
  border-color: var(--va-blue);
  box-shadow: 0 0 0 4px rgba(26,111,181,0.12);
  outline: 2px solid var(--va-blue);
  outline-offset: 1px;
}

/* Primary Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--va-blue);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  padding: 16px 28px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-fast) var(--ease);
  box-shadow: 0 2px 8px rgba(26,111,181,0.25);
}
.btn-primary:hover {
  background: #1862A0;
  box-shadow: 0 4px 16px rgba(26,111,181,0.35);
  transform: translateY(-1px);
  color: #fff;
}
.btn-primary:active { transform: translateY(0); }

.login-footer-text {
  margin-top: 36px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  text-align: center;
}

/* ═══════════════════════════════════════
   ACADEMY HOME — Banner
   ═══════════════════════════════════════ */
.academy-banner {
  background: linear-gradient(145deg, var(--va-navy) 0%, var(--va-navy-mid) 50%, #1A4A70 100%);
  color: var(--text-on-dark);
  padding: 56px 24px 48px;
  position: relative;
  overflow: hidden;
}
/* Decorative radial glow */
.academy-banner::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,168,56,0.08) 0%, transparent 70%);
  top: -200px; right: -100px;
  pointer-events: none;
}

.banner-content {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}
.banner-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  padding: 6px;
}
.banner-title {
  font-family: var(--font-display);
  font-size: 36px;
  color: #fff;
  margin: 0 0 12px;
}
.banner-tagline {
  font-size: 19px;
  color: var(--va-gold-light);
  margin: 0 0 16px;
  font-weight: 500;
}
.banner-sub {
  font-size: 15px;
  color: rgba(255,255,255,0.7);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ═══════════════════════════════════════
   TUTOR CARDS GRID
   ═══════════════════════════════════════ */
.tutor-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 20px;
}

.section-heading {
  font-size: 26px;
  text-align: center;
  margin: 0 0 32px;
  color: var(--va-navy);
}

.tutor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.tutor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: all var(--t-med) var(--ease);
  position: relative;
  overflow: hidden;
}
/* Top accent bar */
.tutor-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--card-accent, var(--va-blue));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.tutor-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--border-strong);
}
.tutor-card--coming { opacity: 0.75; }
.tutor-card--coming:hover { opacity: 0.88; transform: translateY(-2px); }

.tutor-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tutor-icon {
  font-size: 36px;
  line-height: 1;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--card-accent, var(--va-blue)) 10%, transparent);
}

.tutor-badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
}
.tutor-badge--live {
  background: #DCFCE7;
  color: #166534;
}
.tutor-badge--beta {
  background: #FEF3C7;
  color: #92400E;
}
.tutor-badge--soon {
  background: var(--surface-alt);
  color: var(--text-muted);
}

.tutor-card-title {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 8px;
  color: var(--va-navy);
}

.tutor-card-tagline {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 10px;
  line-height: 1.5;
}

.tutor-card-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.65;
  flex-grow: 1;
}

.tutor-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.feature-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--surface-alt);
  color: var(--text-secondary);
}

.tutor-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.btn-launch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--t-fast) var(--ease);
  background: var(--card-accent, var(--va-blue));
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.btn-launch:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  color: #fff;
  filter: brightness(1.08);
}

.btn-launch--disabled {
  background: var(--surface-alt);
  color: var(--text-muted);
  cursor: default;
  box-shadow: none;
  pointer-events: none;
}

.tutor-version {
  font-size: 12px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════
   ABOUT SECTION
   ═══════════════════════════════════════ */
.info-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  text-align: center;
  transition: box-shadow var(--t-med) var(--ease);
}
.info-card:hover { box-shadow: var(--shadow-md); }

.info-icon {
  font-size: 32px;
  margin-bottom: 12px;
}
.info-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0 0 8px;
}
.info-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

/* ═══════════════════════════════════════
   COMING SOON PAGE
   ═══════════════════════════════════════ */
.coming-soon-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 60px 24px 80px;
  text-align: center;
}
.coming-soon-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 48px 36px;
  position: relative;
  overflow: hidden;
}
.coming-soon-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--card-accent, var(--va-blue));
}
.coming-icon { font-size: 52px; display: block; margin-bottom: 16px; }
.coming-title {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 10px;
}
.coming-tagline {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0 0 12px;
  font-weight: 500;
}
.coming-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 24px;
  line-height: 1.65;
}
.coming-badge {
  display: inline-block;
  padding: 8px 24px;
  border-radius: 100px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}
.coming-note {
  font-size: 14px;
  color: var(--text-muted);
}
.coming-note a { font-weight: 600; }

/* ═══════════════════════════════════════
   404 PAGE
   ═══════════════════════════════════════ */
.error-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}
.error-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 48px 36px;
}
.error-code {
  font-family: var(--font-display);
  font-size: 72px;
  color: var(--border-strong);
  line-height: 1;
  margin-bottom: 12px;
}
.error-card h1 {
  font-size: 24px;
  margin: 0 0 8px;
}
.error-card p {
  color: var(--text-muted);
  margin: 0 0 28px;
}

/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */
.site-footer {
  background: var(--va-navy);
  color: rgba(255,255,255,0.7);
  padding: 28px 24px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-brand {
  font-size: 13px;
  margin: 0;
  line-height: 1.6;
}
.footer-brand strong { color: #fff; }
.footer-links { margin: 0; }
.footer-links a {
  color: var(--va-gold-light);
  font-size: 13px;
  text-decoration: none;
  font-weight: 600;
}
.footer-links a:hover { color: var(--va-gold); text-decoration: underline; }

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
  .login-page {
    grid-template-columns: 1fr;
  }
  .login-hero {
    padding: 40px 24px 36px;
  }
  .hero-title { font-size: 28px; }
  .hero-accent { font-size: 24px; }
  .hero-logo { width: 72px; height: 72px; }
  .login-form-area { padding: 32px 24px; }

  .banner-title { font-size: 26px; }
  .academy-banner { padding: 36px 20px 32px; }

  .tutor-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }

  .header-inner { height: auto; padding: 12px 16px; flex-wrap: wrap; }
  .brand-sub { display: none; }

  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 24px; }
  .hero-accent { font-size: 20px; }
  .hero-tagline { font-size: 15px; }
  .banner-title { font-size: 22px; }
  .brand-name { font-size: 18px; }
}

/* ═══════════════════════════════════════
   ANIMATIONS — subtle, respects reduce motion
   ═══════════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {
  .tutor-card {
    animation: fadeInUp var(--t-slow) var(--ease) both;
  }
  .tutor-card:nth-child(1) { animation-delay: 0ms; }
  .tutor-card:nth-child(2) { animation-delay: 80ms; }
  .tutor-card:nth-child(3) { animation-delay: 160ms; }
  .tutor-card:nth-child(4) { animation-delay: 240ms; }
  .tutor-card:nth-child(5) { animation-delay: 320ms; }

  .info-card {
    animation: fadeInUp var(--t-slow) var(--ease) both;
  }
  .info-card:nth-child(1) { animation-delay: 50ms; }
  .info-card:nth-child(2) { animation-delay: 130ms; }
  .info-card:nth-child(3) { animation-delay: 210ms; }
  .info-card:nth-child(4) { animation-delay: 290ms; }

  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ═══════════════════════════════════════
   VOICE BAR — Start / Stop Speaking
   ═══════════════════════════════════════ */
.voice-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  margin: 0 auto 20px auto;
  max-width: 900px;
  background: linear-gradient(135deg, #F5C563 0%, #E8B04A 100%);
  border-radius: 14px;
  flex-wrap: wrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}
.btn-voice-start {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0D2137;
  color: #fff;
  font-size: 1.15rem;
  padding: 14px 28px;
  min-height: 54px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.30);
  transition: background 0.2s, transform 0.15s;
}
.btn-voice-start:hover {
  background: #1A3A5C;
  transform: translateY(-1px);
}
.btn-voice-start:focus-visible {
  outline: 3px solid #F5C563;
  outline-offset: 3px;
}
.btn-voice-stop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  padding: 14px 24px;
  min-height: 54px;
  border-radius: 10px;
  font-weight: 700;
  background: rgba(255,255,255,0.25);
  border: 2px solid #0D2137;
  color: #0D2137;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-voice-stop:hover {
  background: rgba(255,255,255,0.5);
}
.btn-voice-stop:focus-visible {
  outline: 3px solid #0D2137;
  outline-offset: 3px;
}
.voice-bar-status {
  font-weight: 600;
  color: #0D2137;
  font-size: 0.95rem;
}

/* Position voice bar inside login page */
.login-page .voice-bar {
  position: relative;
  z-index: 10;
  margin: 16px auto;
}

/* ═══════════════════════════════════════
   AUDIO FLOATING BUTTON + PANEL
   ═══════════════════════════════════════ */
.audio-fab {
  position: relative; background: transparent; border: none;
  cursor: pointer; font-size: 1.5rem; padding: 6px 10px;
  border-radius: 50%; transition: background 0.2s; line-height: 1;
  margin-left: 8px;
}
.audio-fab:hover { background: rgba(0,0,0,0.05); }
.audio-fab:focus-visible { outline: 3px solid #D4A843; outline-offset: 2px; }
.audio-fab-icon { position: relative; z-index: 1; }
.audio-fab-pulse {
  display: none; position: absolute; top: 50%; left: 50%;
  width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border-radius: 50%; background: #22C55E; opacity: 0.5;
  animation: audioPulse 1.2s ease-in-out infinite; pointer-events: none;
}
.audio-fab.is-playing .audio-fab-pulse { display: block; }
@keyframes audioPulse {
  0%, 100% { transform: scale(0.8); opacity: 0.3; }
  50% { transform: scale(1.3); opacity: 0.6; }
}
.audio-panel-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 9998; backdrop-filter: blur(2px);
}
.audio-panel-overlay[hidden] { display: none; }
.audio-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(400px, 90vw); background: #fff;
  border-left: 3px solid #D4A843; z-index: 9999;
  overflow-y: auto; box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  animation: panelSlideIn 0.25s ease-out; color: #1a2a3a;
}
.audio-panel[hidden] { display: none; }
@keyframes panelSlideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.audio-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #e5e7eb;
}
.audio-panel-title { font-size: 1.15rem; margin: 0; color: #0D2137; }
.audio-panel-close {
  background: transparent; border: none; font-size: 1.5rem;
  color: #6B7280; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.audio-panel-close:hover { color: #111; background: #f3f4f6; }
.audio-panel-body { padding: 16px 20px; }
.audio-status {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px; background: #f9fafb;
  margin-bottom: 16px; font-weight: 600;
}
.audio-status-dot { width: 12px; height: 12px; border-radius: 50%; background: #888; flex-shrink: 0; }
.audio-status-dot.ok { background: #22C55E; }
.audio-status-dot.warn { background: #F59E0B; }
.audio-status-dot.err { background: #EF4444; }
.audio-fieldset {
  border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 12px 14px; margin: 0 0 12px 0;
}
.audio-fieldset legend { font-weight: 700; font-size: 0.95rem; padding: 0 6px; color: #0D2137; }
.audio-help { font-size: 0.85rem; color: #6B7280; margin: 4px 0 8px 0; line-height: 1.4; }
.audio-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.audio-test-btn {
  font-size: 0.9rem; padding: 8px 16px; min-height: 40px;
  border-radius: 8px; background: #0D2137; color: #fff;
  border: none; cursor: pointer; font-weight: 600;
}
.audio-test-btn:hover { background: #1a3a5c; }
.audio-test-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.audio-test-status { font-size: 0.85rem; font-weight: 600; }
.audio-test-status.ok { color: #15803D; } /* Dark green: 6:1 on white */
.audio-test-status.err { color: #B91C1C; } /* Dark red: 5.7:1 on white */
.audio-test-status.busy { color: #92400E; } /* Dark amber: 6.8:1 on white */
.audio-check-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.audio-check-row label { cursor: pointer; }
.audio-divider { border: none; border-top: 1px solid #e5e7eb; margin: 16px 0; }
.audio-meter-bar { height: 8px; border-radius: 4px; background: #e5e7eb; margin-top: 8px; overflow: hidden; }
.audio-meter-fill { height: 100%; width: 0%; background: #22C55E; border-radius: 4px; transition: width 0.1s; }
.audio-panel input[type="range"] { flex: 1; min-width: 100px; accent-color: #D4A843; }

@media (prefers-reduced-motion: reduce) {
  .audio-fab-pulse { animation: none; opacity: 0.5; }
  .audio-panel { animation: none; }
}

/* Global reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════
   STUDENT BADGE (Academy home)
   ═══════════════════════════════════════ */
.student-badge {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  background: rgba(255,255,255,0.12); border-radius: 12px;
  padding: 10px 18px; margin-top: 16px; font-size: 0.95rem;
}
.student-badge--guest {
  background: rgba(255,255,255,0.06);
  border: 1px dashed rgba(255,255,255,0.25);
}
.student-badge-name { font-weight: 700; }
.student-badge-code { font-family: monospace; opacity: 0.7; font-size: 0.85rem; }
.student-badge-lang { opacity: 0.8; font-size: 0.85rem; }
.student-badge-switch,
.student-badge .btn-small {
  font-size: 0.8rem; padding: 4px 12px;
  background: rgba(255,255,255,0.15); border-radius: 6px;
  color: #fff; text-decoration: none; font-weight: 600;
  transition: background 0.2s;
}
.student-badge-switch:hover,
.student-badge .btn-small:hover { background: rgba(255,255,255,0.25); }

/* ═══════════════════════════════════════
   LOGIN FORM EXTRAS
   ═══════════════════════════════════════ */
.login-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text-muted, #6B7280);
  font-size: 0.85rem;
}
.login-divider::before,
.login-divider::after {
  content: ""; flex: 1; height: 1px;
  background: var(--border, #e5e7eb);
}
.btn-secondary-link {
  display: block; text-align: center;
  padding: 12px 16px; border-radius: 10px;
  font-weight: 600; font-size: 0.95rem;
  color: var(--primary, #0D2137);
  background: var(--bg-alt, #f3f4f6);
  text-decoration: none;
  transition: background 0.2s;
}
.btn-secondary-link:hover { background: #e5e7eb; }
.btn-secondary-link:focus-visible {
  outline: 3px solid #D4A843; outline-offset: 2px;
}
.required { color: #DC2626; }
.form-hint {
  display: block; font-size: 0.8rem;
  color: var(--text-muted, #6B7280); margin-top: 4px;
}
