/* ==========================================================================
   INTERACTIVE VIDEO LEARNING - MODERN CINEMATIC DARK THEME
   ========================================================================== */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.75);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(99, 102, 241, 0.35);

  --accent-purple: #6366f1;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-normal: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(6, 182, 212, 0.10) 0%, transparent 45%);
  background-attachment: fixed;
}

/* Global Utility Classes */
.hidden {
  display: none !important;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 0.85rem 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.25rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-logo-text,
.nav-brand-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  display: inline-block;
  line-height: 1;
}

.nav-logo-emblem {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.45), 0 0 24px rgba(99, 102, 241, 0.25);
  border: 1.5px solid rgba(56, 189, 248, 0.75);
  background: #020617;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nav-logo:hover .nav-logo-emblem {
  transform: rotate(8deg) scale(1.08);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.75), 0 0 35px rgba(99, 102, 241, 0.45);
}

.nav-emblem-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
  border: 1.5px solid rgba(245, 158, 11, 0.85);
  background: #090e17;
}

/* Navigation Links (Anchor Text Links) */
.nav-link-anchor {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: none;
  border-radius: 6px;
  transition: color 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}

.nav-link-anchor:hover {
  color: #38bdf8;
  background: transparent;
  transform: translateY(-1px);
}

/* Prominent CTA Buttons */
.btn-nav-cta {
  background: rgba(99, 102, 241, 0.18) !important;
  border: 1px solid rgba(99, 102, 241, 0.45) !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-nav-cta:hover {
  background: rgba(99, 102, 241, 0.35) !important;
  border-color: #6366f1 !important;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4) !important;
  transform: translateY(-1px);
}

/* Auth Field Validation Error */
.auth-field-error {
  color: #f43f5e;
  font-size: 0.82rem;
  margin-top: 0.4rem;
  font-weight: 500;
  line-height: 1.4;
  display: none;
}

.auth-field-error.visible {
  display: block;
}

.auth-input.input-error {
  border-color: #f43f5e !important;
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.25) !important;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-hamburger {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: var(--transition-normal);
}

.btn-hamburger:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #ffffff;
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
}

.mobile-nav-drawer.hidden {
  display: none !important;
}

.mobile-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mobile-drawer-card {
  position: relative;
  width: 300px;
  max-width: 85vw;
  height: 100%;
  background: #0b1120;
  border-right: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 20px 0 50px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  animation: drawerSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

@keyframes drawerSlideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.drawer-header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.drawer-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.15rem;
}

.drawer-brand-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffffff;
}

.drawer-brand-sub {
  font-size: 0.75rem;
  color: #38bdf8;
}

.btn-drawer-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.btn-drawer-close:hover {
  color: #ffffff;
}

.mobile-drawer-body {
  flex: 1;
}

.drawer-nav-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 0.75rem;
}

.drawer-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.drawer-link-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: var(--transition-normal);
}

.drawer-link-item:hover, .drawer-link-item.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
  color: #ffffff;
}

.mobile-drawer-footer {
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.5;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-normal);
}

.btn-nav:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-nav.active {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

/* Header & Hero */
.hero-header {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.gradient-text {
  background: linear-gradient(135deg, #38bdf8, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 680px;
  margin: 0 auto;
}

/* Scenario Selector Cards */
.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.scenario-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.scenario-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--theme-color, var(--accent-purple));
  opacity: 0.8;
  transition: var(--transition-normal);
}

.scenario-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 20px rgba(99, 102, 241, 0.2);
}

.scenario-card.active {
  border-color: var(--theme-color, var(--accent-purple));
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.35);
}

.scenario-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.scenario-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scenario-diff {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.diff-Beginner { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.diff-Intermediate { background: rgba(59, 130, 246, 0.18); color: #60a5fa; }
.diff-Advanced { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }

.scenario-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.scenario-title-vi {
  color: var(--accent-cyan);
  font-size: 0.88rem;
  margin-bottom: 0.65rem;
  font-weight: 500;
}

.scenario-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.scenario-checkpoints-preview {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.cp-preview-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
}

.cp-preview-item strong {
  color: var(--text-main);
  font-weight: 600;
}

.btn-start-scenario {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-normal);
}

.btn-start-scenario:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* ==========================================================================
   VIDEO PLAYER THEATER
   ========================================================================== */
.player-wrapper {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.player-info-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.player-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}

.media-element {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

canvas.media-element {
  display: block;
}

/* ==========================================================================
   INTERACTIVE TIMELINE & CONTROLS
   ========================================================================== */
.player-controls {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timeline-wrapper {
  position: relative;
  width: 100%;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.timeline-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  position: relative;
  overflow: visible;
}

.timeline-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
  border-radius: var(--radius-full);
  position: relative;
}

.timeline-handle {
  position: absolute;
  right: -6px;
  top: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* Checkpoint Flags on Timeline */
.timeline-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s ease;
}

.timeline-marker:hover {
  transform: translate(-50%, -50%) scale(1.25);
}

.timeline-wrapper.locked {
  cursor: not-allowed;
  opacity: 0.85;
}

.timeline-marker.cp1,
.timeline-marker.multiple_choice {
  background: var(--accent-purple);
  border: 2px solid #a5b4fc;
}

.timeline-marker.cp2,
.timeline-marker.speech_roleplay {
  background: var(--accent-rose);
  border: 2px solid #fda4af;
}

.timeline-marker.completed {
  background: var(--accent-emerald) !important;
  border-color: #6ee7b7 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.timeline-marker-tooltip {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  border: 1px solid var(--border-glass);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.timeline-marker:hover .timeline-marker-tooltip {
  opacity: 1;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-ctrl {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-normal);
}

.btn-ctrl:hover {
  background: rgba(255, 255, 255, 0.16);
}

.btn-ctrl-primary {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  border: none;
  font-weight: 600;
}

.time-display {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   MODAL / OVERLAYS (Multiple Choice & Speaking Roleplay)
   Fixed viewport overlay so it is NEVER trapped or squished inside the video box
   ========================================================================== */
.overlay-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.75); /* fixed inset-0 bg-black/75 */
  backdrop-filter: blur(8px); /* backdrop-blur-sm */
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000; /* Cao hơn toàn bộ navbar và video player */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.overlay-modal.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.modal-card {
  box-sizing: border-box;
  width: calc(100% - 32px); /* w-[calc(100%-32px)] */
  max-width: 32rem; /* max-w-lg */
  margin: auto; /* mx-auto */
  max-height: 85vh; /* max-height: 85vh */
  overflow-y: auto; /* overflow-y-auto */
  -webkit-overflow-scrolling: touch;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1.25rem;
  padding: 1.5rem 1.35rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 35px rgba(99, 102, 241, 0.25);
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  position: relative;
}

@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: fit-content;
}

.badge-mc {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.badge-speech {
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
}

.modal-context {
  background: rgba(0, 0, 0, 0.35);
  border-left: 3px solid var(--accent-cyan);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
  color: #cbd5e1;
}

/* Question & Multiple Choice Options */
.mc-question-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.mc-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mc-option-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: var(--transition-normal);
  text-align: left;
  color: var(--text-main);
}

.mc-option-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateX(3px);
}

.mc-option-key {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.mc-option-text {
  font-size: 0.95rem;
  line-height: 1.4;
  flex-grow: 1;
}

.mc-option-card.correct {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: var(--accent-emerald) !important;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
}

.mc-option-card.correct .mc-option-key {
  background: var(--accent-emerald);
  color: #022c22;
}

.mc-option-card.incorrect {
  background: rgba(244, 63, 94, 0.15) !important;
  border-color: var(--accent-rose) !important;
  animation: shake 0.4s ease;
}

.mc-option-card.incorrect .mc-option-key {
  background: var(--accent-rose);
  color: #4c0519;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.mc-feedback-box {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.4;
}

.mc-feedback-box.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
}

.mc-feedback-box.error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fecdd3;
}

/* ==========================================================================
   MICROPHONE SPEAKING ROLEPLAY UI
   ========================================================================== */
.speech-target-box {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}

.speech-target-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.speech-target-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.speech-phonetic {
  font-family: monospace;
  font-size: 0.88rem;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
}

.speech-translation {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
}

.speech-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.btn-tts {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: #38bdf8;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-normal);
}

.btn-tts:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
}

/* Big Mic Button & Waveform */
.mic-control-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0;
}

.btn-mic-main {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-rose), #e11d48);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.4);
  transition: var(--transition-normal);
  position: relative;
}

.btn-mic-main:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 30px rgba(244, 63, 94, 0.6);
}

.btn-mic-main.recording {
  animation: micPulse 1.2s infinite;
  background: #ef4444;
}

@keyframes micPulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 22px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.mic-status-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Waveform visualizer */
.waveform-bars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 36px;
}

.wave-bar {
  width: 4px;
  height: 8px;
  background: var(--accent-rose);
  border-radius: 2px;
  transition: height 0.1s ease;
}

.recording .wave-bar {
  animation: waveAnim 0.8s infinite ease-in-out;
}

.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }
.wave-bar:nth-child(6) { animation-delay: 0.25s; }
.wave-bar:nth-child(7) { animation-delay: 0.15s; }

@keyframes waveAnim {
  0%, 100% { height: 6px; }
  50% { height: 28px; }
}

/* User speech result & Word Diff */
.speech-result-box {
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  padding: 1rem;
  border: 1px solid var(--border-glass);
}

.speech-result-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.speech-words-diff {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.diff-word {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.diff-word.matched {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.diff-word.unmatched {
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Score radial / bar */
.speech-score-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.score-badge {
  font-size: 1.1rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.score-badge.passed {
  color: #34d399;
}

.score-badge.failed {
  color: #f87171;
}

.fallback-input-row {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
}

.input-fallback {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.btn-proceed {
  width: 100%;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  transition: var(--transition-normal);
}

.btn-proceed:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

/* Completion Modal */
.completion-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}

.stat-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.stat-lbl {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   SITE RICH FOOTER (FOOTNOTE) - THEME MATCHING REFERENCE DESIGN
   ========================================================================== */

.site-rich-footer {
  background: #080c14;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 4.5rem;
  position: relative;
  z-index: 10;
  width: 100%;
  box-sizing: border-box;
}

/* Top Award Ribbon */
.footer-award-ribbon {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.04) 0%, rgba(245, 158, 11, 0.12) 50%, rgba(245, 158, 11, 0.04) 100%);
  border-top: 1px solid rgba(245, 158, 11, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0.9rem 1.25rem;
  text-align: center;
  font-size: 0.88rem;
  color: #e2e8f0;
  line-height: 1.5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.footer-award-ribbon strong {
  color: #fbbf24;
  font-weight: 700;
}

.footer-award-ribbon .sep {
  color: #64748b;
  margin: 0 0.5rem;
  display: inline-block;
}

/* Footer Main Container */
.footer-main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.25rem 1.5rem 1.75rem;
  box-sizing: border-box;
}

/* 2-Column Top Grid (Brand & Teacher Info) */
.footer-grid-2col,
.footer-grid-3col {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 3.5rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

/* Column 1: Brand Info */
.footer-col-brand {
  display: flex;
  flex-direction: column;
}

.footer-brand-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.footer-brand-emblem {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 35% 35%, #1e293b, #020617);
  border: 2px solid rgba(56, 189, 248, 0.75);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4), 0 0 30px rgba(99, 102, 241, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.footer-brand-emblem:hover {
  transform: rotate(8deg) scale(1.06);
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.75);
}

.footer-brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
}

.footer-brand-subtitle {
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 500;
  margin-top: 3px;
  margin-bottom: 0;
}

.footer-brand-desc {
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.65;
  margin: 0;
}

/* Column Headings */
.footer-col-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 1.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.footer-col-heading i {
  color: #38bdf8;
  font-size: 1.1rem;
}

/* Column 2: Teacher Info */
.footer-teacher-name {
  font-size: 1.12rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.footer-teacher-role {
  font-size: 0.88rem;
  color: #94a3b8;
  margin-bottom: 1.15rem;
  line-height: 1.45;
}

.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: #cbd5e1;
}

.footer-contact-item i {
  width: 18px;
  text-align: center;
  color: #38bdf8;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.footer-contact-item a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-contact-item a:hover {
  color: #38bdf8;
  text-decoration: underline;
}

/* Column 3: Social & Links */
.footer-social-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 500;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

.footer-social-link:hover {
  transform: translateX(4px);
  color: #ffffff;
}

.social-circle-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #ffffff;
  flex-shrink: 0;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.social-fb {
  background: #1877f2;
}

.social-yt {
  background: #ef4444;
}

.social-web {
  background: #10b981;
}

.footer-social-link:hover .social-circle-icon {
  transform: scale(1.08);
}

.footer-social-link:hover .social-fb {
  box-shadow: 0 0 14px rgba(24, 119, 242, 0.55);
}

.footer-social-link:hover .social-yt {
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.55);
}

.footer-social-link:hover .social-web {
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.55);
}

/* Map Section */
.footer-map-section {
  margin-top: 0.5rem;
  margin-bottom: 2.75rem;
}

.footer-map-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.footer-map-label i {
  color: #38bdf8;
  font-size: 1.05rem;
}

.footer-map-container {
  position: relative;
  width: 100%;
  height: 270px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  background: #090e17;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.footer-map-open-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.footer-map-open-btn:hover {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5);
  transform: translateY(-1px);
}

.footer-map-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  /* Night-mode map filter */
  filter: invert(90%) hue-rotate(180deg) contrast(90%) brightness(95%);
  -webkit-filter: invert(90%) hue-rotate(180deg) contrast(90%) brightness(95%);
  display: block;
}

/* Bottom Sub-Footer Bar */
.footer-bottom-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem 0 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.85rem;
}

.footer-bottom-left {
  color: #94a3b8;
}

.footer-bottom-center {
  color: #cbd5e1;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-sparkle {
  color: #fbbf24;
  font-size: 0.95rem;
}

.footer-bottom-right {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-bottom-right a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 0.85rem;
}

.footer-bottom-right a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Responsive Footer */
@media (max-width: 768px) {
  .footer-grid-2col,
  .footer-grid-3col {
    grid-template-columns: 1fr;
    gap: 1.85rem;
  }
  .footer-main-container {
    padding: 2.25rem 1rem 1.25rem;
  }
  .footer-award-ribbon {
    font-size: 0.82rem;
    padding: 0.75rem 0.85rem;
  }
  .footer-map-container {
    height: 220px;
  }
  .footer-bottom-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }
  .footer-bottom-right {
    gap: 1.25rem;
    width: 100%;
    padding-top: 0.65rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
  }
}

/* Policy Dialog Modal */
.policy-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.2s ease-out;
}

.policy-dialog-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 30px rgba(99, 102, 241, 0.15);
  overflow: hidden;
  animation: cardPopEntrance 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.policy-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.policy-dialog-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.policy-dialog-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.3rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.policy-dialog-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.policy-dialog-body {
  padding: 1.5rem;
  overflow-y: auto;
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.65;
}

.policy-dialog-body h5 {
  color: #ffffff;
  font-size: 0.98rem;
  margin-top: 1.1rem;
  margin-bottom: 0.4rem;
}

.policy-dialog-body h5:first-child {
  margin-top: 0;
}

/* Fallback legacy footer style */
.footer {
  text-align: center;
  padding: 2.5rem 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-glass);
  margin-top: 3rem;
}

/* ==========================================================================
   MOBILE OPTIMIZATION (6 PILLARS & THUMB ZONE ERGONOMICS)
   ========================================================================== */

/* Prevent Safari iOS automatic viewport zoom on input focus */
@media (max-width: 768px) {
  input, select, textarea, .auth-input {
    font-size: 16px !important;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero-title {
    font-size: 1.65rem;
    line-height: 1.25;
  }

  /* Ergonomics: Horizontal Scenario Carousel with Scroll Snap */
  .scenarios-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding-bottom: 0.75rem;
    scrollbar-width: none;
  }

  .scenarios-grid::-webkit-scrollbar {
    display: none;
  }

  .scenario-card {
    flex: 0 0 88%;
    max-width: 340px;
    scroll-snap-align: center;
  }

  /* Player controls touch target sizing */
  .btn-ctrl {
    min-width: 44px;
    min-height: 44px;
  }

  .btn-ctrl-primary {
    min-height: 48px;
    padding: 0 1.25rem;
  }

  .timeline-track {
    height: 12px;
  }

  .timeline-handle {
    width: 20px;
    height: 20px;
  }
}

/* Responsive Navbar Rules */
@media (max-width: 840px) {
  .hidden-mobile,
  .navbar .btn-nav,
  .navbar .nav-link-anchor {
    display: none !important;
  }
  .nav-logo {
    gap: 0.5rem;
  }
  .nav-logo-text,
  .nav-brand-text,
  .nav-logo span {
    font-size: 1.05rem !important;
    white-space: nowrap !important;
    max-width: none !important;
  }
  .user-profile-pill {
    padding: 0.25rem 0.45rem;
    gap: 0.35rem;
  }
  .user-pill-role {
    display: none !important;
  }
  .user-pill-name {
    font-size: 0.78rem;
    max-width: 75px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .btn-auth-trigger span {
    display: none;
  }
  .btn-auth-trigger {
    padding: 0.45rem;
    width: 38px;
    height: 38px;
    justify-content: center;
  }
  .btn-hamburger {
    display: inline-flex !important;
    width: 38px;
    height: 38px;
    padding: 0;
    align-items: center;
    justify-content: center;
  }
}

/* ==========================================================================
   PLAYER META HEADER (Dòng 1: Tên bài, Dòng 2: Badges + Đổi tình huống)
   ========================================================================== */
.player-meta-box {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.95rem;
}

/* Dòng 1: Tên bài học ("At the Restaurant") hiển thị rõ ràng, không bị dính chùm hay đè lên nút */
.player-lesson-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.3;
  margin: 0;
  word-break: break-word;
}

@media (max-width: 640px) {
  .player-lesson-title {
    font-size: 1.15rem;
    line-height: 1.35;
  }
  .player-wrapper {
    padding: 0.85rem !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(99, 102, 241, 0.15) !important;
  }
  .player-stage {
    border-radius: 12px;
  }
}

/* Dòng 2: Các tag ("Beginner", nhân vật) căn trái, nút "Đổi tình huống" căn phải */
.player-badges-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.player-badges-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Nút "Đổi tình huống" - Style theme tối nổi bật, border mỏng bo góc rounded-full, h-9, active:scale-95 */
.btn-change-scenario {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 36px; /* h-9 */
  padding: 0 0.85rem; /* py-1.5 px-3.5 */
  border-radius: var(--radius-full);
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.5);
  color: #e0e7ff;
  font-size: 0.82rem; /* text-xs / text-sm font-medium */
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-change-scenario i {
  font-size: 0.82rem;
  color: #818cf8;
  transition: transform 0.15s ease;
}

.btn-change-scenario:hover {
  background: rgba(49, 46, 129, 0.7);
  border-color: rgba(129, 140, 248, 0.8);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-change-scenario:hover i {
  color: #c7d2fe;
}

.btn-change-scenario:active {
  transform: scale(0.95); /* active:scale-95 trên mobile */
}

/* ==========================================================================
   INTERACTION TRACKER TIMELINE (Giao diện chuẩn hình 1 - Không vỡ chữ)
   ========================================================================== */
.interaction-tracker-bar {
  margin-top: 0.85rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
}

.interaction-tracker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.interaction-tracker-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.interaction-tracker-label strong {
  color: #38bdf8;
  font-weight: 700;
}

.interaction-status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  white-space: nowrap;
  flex-shrink: 0;
}

.interaction-progress-track {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: visible;
}

.interaction-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #06b6d4);
  border-radius: 9999px;
  transition: width 0.15s linear;
}

.interaction-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.interaction-step-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  cursor: pointer;
  pointer-events: auto;
  transition: var(--transition-normal);
}

.interaction-step-dot.completed {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.interaction-step-dot.active {
  background: #6366f1;
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.8);
}

/* ==========================================================================
   ANTI-CHEAT IN-VIDEO FLOATING CONTROLS & TIMELINE
   ========================================================================== */
.player-center-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  color: #ffffff;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 15;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.6);
  transition: transform 0.18s ease, opacity 0.25s ease;
}

.player-center-play:active {
  transform: translate(-50%, -50%) scale(0.92);
}

.player-center-play.hidden {
  opacity: 0;
  pointer-events: none;
}

.anti-skip-toast {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(245, 158, 11, 0.6);
  backdrop-filter: blur(8px);
  color: #fbbf24;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  z-index: 25;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  white-space: nowrap;
  animation: toastFade 0.25s ease;
  transition: opacity 0.25s ease;
}

.anti-skip-toast.hidden {
  display: none !important;
}

@keyframes toastFade {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.player-invideo-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.92) 0%, rgba(2, 6, 23, 0.5) 60%, transparent 100%);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 1.25rem 0.85rem 0.65rem;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.player-invideo-bar.autohide {
  opacity: 0;
  pointer-events: none;
}

.player-stage:hover .player-invideo-bar,
.player-stage:focus-within .player-invideo-bar {
  opacity: 1;
  pointer-events: auto;
}

.btn-iv-ctrl {
  background: transparent;
  border: none;
  color: #f1f5f9;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.3rem 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}

.btn-iv-ctrl:hover {
  color: #38bdf8;
}

.btn-iv-ctrl:active {
  transform: scale(0.92);
}

.iv-time-display {
  font-size: 0.78rem;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.iv-timeline-container {
  flex: 1;
  min-width: 50px;
  height: 24px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  touch-action: none;
}

.iv-timeline-track {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  overflow: visible;
}

.iv-timeline-watched {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(56, 189, 248, 0.45);
  border-radius: 9999px;
  transition: width 0.15s linear;
}

.iv-timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #06b6d4);
  border-radius: 9999px;
  transition: width 0.1s linear;
}

.iv-timeline-pin {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}

.iv-timeline-lock {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 8px;
  color: #fbbf24;
  background: #0f172a;
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  transition: left 0.15s linear;
}

/* ==========================================================================
   MICROPHONE PERMISSION ONBOARDING MODAL
   ========================================================================== */
.mic-permission-modal {
  position: fixed;
  inset: 0;
  z-index: 10005;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.mic-permission-modal.hidden {
  display: none !important;
}

.mic-permission-card {
  background: #0f172a;
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  padding: 2rem;
  text-align: center;
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mic-perm-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.25));
  border: 1px solid rgba(99, 102, 241, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  color: #38bdf8;
  margin-bottom: 1.25rem;
}

.mic-perm-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.6rem;
}

.mic-perm-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.mic-perm-tips {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  text-align: left;
}

.mic-tip-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.mic-perm-error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 1rem;
  text-align: left;
}

.mic-perm-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-allow-mic {
  width: 100%;
  min-height: 48px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
  transition: var(--transition-normal);
}

.btn-allow-mic:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.55);
}

.btn-skip-mic {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.4rem;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.btn-skip-mic:hover {
  color: #ffffff;
}

/* Full Screen Transformation for Checkpoint Overlays & Dialogs (Max width 900px) */
@media (max-width: 900px) {
  /* Khung câu hỏi / Dialog tương tác (Interactive Question Box)
   * 1. fixed inset-0 bg-black/75 backdrop-blur-sm, z-index cao hơn navbar và player (z-50+)
   * 2. w-[calc(100%-32px)] max-w-lg mx-auto cách viền 16px hai bên
   * 3. box-sizing: border-box, max-height: 85vh kèm overflow-y: auto
   */
  .overlay-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: rgba(0, 0, 0, 0.75) !important; /* bg-black/75 */
    backdrop-filter: blur(8px) !important; /* backdrop-blur-sm */
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 10000 !important; /* Cao hơn toàn bộ navbar và video player */
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .overlay-modal.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .modal-card {
    box-sizing: border-box !important;
    width: calc(100% - 32px) !important; /* w-[calc(100%-32px)] cách viền 16px */
    max-width: 32rem !important; /* max-w-lg = 512px */
    margin: auto !important; /* mx-auto */
    max-height: 85vh !important; /* max-height: 85vh */
    overflow-y: auto !important; /* overflow-y-auto */
    -webkit-overflow-scrolling: touch !important;
    background: #0f172a !important; /* Slate tối sang trọng, nổi bật trên backdrop */
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 1.25rem !important; /* rounded-2xl */
    padding: 1.25rem 1rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 30px rgba(99, 102, 241, 0.25) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.85rem !important;
  }

  .modal-title {
    font-size: 1.2rem !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    word-break: break-word !important;
  }

  .modal-context {
    padding: 0.65rem 0.85rem !important;
    font-size: 0.88rem !important;
    line-height: 1.45 !important;
    margin: 0 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  /* Multiple Choice Options */
  .mc-question-text {
    font-size: 0.98rem !important;
    line-height: 1.45 !important;
    margin: 0 !important;
    word-break: break-word !important;
  }

  .mc-options-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
    margin: 0.25rem 0 !important;
  }

  .mc-option-card {
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 48px !important;
    padding: 0.75rem 0.85rem !important;
    gap: 0.65rem !important;
    align-items: center !important;
    border-radius: 12px !important;
    word-break: break-word !important;
  }

  .opt-letter {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    font-size: 0.9rem !important;
  }

  .opt-text {
    font-size: 0.92rem !important;
    line-height: 1.35 !important;
  }

  .btn-proceed {
    width: 100% !important;
    min-height: 46px !important;
    font-size: 0.95rem !important;
    border-radius: 12px !important;
    margin-top: 0.25rem !important;
  }

  /* Microphone & Speech Elements */
  .btn-mic-main {
    width: 72px !important;
    height: 72px !important;
    font-size: 1.6rem !important;
  }

  .speech-target-box {
    padding: 0.9rem 0.85rem !important;
    border-radius: 12px !important;
    margin: 0 !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .speech-target-text {
    font-size: 1.25rem !important;
    line-height: 1.35 !important;
    margin-bottom: 0.35rem !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .speech-phonetic {
    font-size: 0.85rem !important;
    margin-bottom: 0.35rem !important;
    word-break: break-word !important;
  }

  .speech-translation {
    font-size: 0.85rem !important;
    margin-bottom: 0.5rem !important;
    word-break: break-word !important;
  }

  .mic-control-center {
    gap: 0.65rem !important;
    margin: 0.5rem 0 0.25rem !important;
  }

  /* Auth Modal on Mobile also becomes a Bottom Sheet */
  .auth-modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  .auth-modal-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 24px 24px 0 0 !important;
    border-bottom: none !important;
    padding: 1.5rem 1.25rem calc(1.75rem + env(safe-area-inset-bottom, 16px)) !important;
    animation: bottomSheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .auth-modal-card::before {
    content: '' !important;
    display: block !important;
    width: 44px !important;
    height: 5px !important;
    background: rgba(255, 255, 255, 0.28) !important;
    border-radius: 9999px !important;
    margin: -0.5rem auto 1rem !important;
  }

  .btn-auth-submit {
    min-height: 48px !important;
  }
}

/* ==========================================================================
   AUTHENTICATION MODAL & USER STATUS BAR STYLES
   ========================================================================== */

.user-auth-slot {
  display: inline-flex;
  align-items: center;
}

.btn-auth-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
}

.btn-auth-trigger:hover {
  background: rgba(99, 102, 241, 0.3);
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.6);
}

.user-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
}

.user-pill-avatar {
  font-size: 1.25rem;
}

.user-pill-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.user-pill-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.user-pill-role {
  font-size: 0.72rem;
  color: #38bdf8;
  font-weight: 500;
}

.btn-user-logout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  margin-left: 0.25rem;
  font-size: 0.9rem;
  transition: var(--transition-normal);
}

.btn-user-logout:hover {
  color: #f43f5e;
}

/* Modal Overlay */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.auth-modal-overlay.hidden {
  display: none !important;
}

.auth-form.hidden {
  display: none !important;
}

.auth-error-box.hidden,
.auth-error-box:empty {
  display: none !important;
}

.auth-modal-card {
  background: #0f172a;
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 2.25rem;
  position: relative;
  animation: modalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.btn-auth-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
}

.btn-auth-close:hover {
  color: #ffffff;
}

.auth-modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-header-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.auth-modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.auth-modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.auth-tabs-row {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  margin-bottom: 1.5rem;
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition-normal);
}

.auth-tab-btn.active {
  background: #6366f1;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.auth-error-box {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.auth-input-group {
  margin-bottom: 1.15rem;
  text-align: left;
}

.auth-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.4rem;
}

.auth-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition-normal);
}

.auth-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.auth-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.auth-hint-text {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.btn-auth-submit {
  width: 100%;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  border: none;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-normal);
}

.btn-auth-submit:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-1px);
}

/* ==========================================================================
   PASSWORD SECURITY UI & LIVE STRENGTH CHECKLIST
   ========================================================================== */
.auth-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-password-wrapper .auth-input {
  padding-right: 2.75rem;
}

.btn-toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.95rem;
  transition: color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-toggle-password:hover {
  color: #38bdf8;
}

.password-strength-container {
  margin-top: 0.5rem;
  margin-bottom: 0.45rem;
}

.strength-bar-track {
  display: flex;
  gap: 5px;
  height: 4px;
  margin-bottom: 0.35rem;
}

.strength-bar-segment {
  flex: 1;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  transition: background 0.25s ease;
}

.strength-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.73rem;
  color: #94a3b8;
}

.str-text-weak { color: #f43f5e; font-weight: 700; }
.str-text-fair { color: #fbbf24; font-weight: 700; }
.str-text-good { color: #38bdf8; font-weight: 700; }
.str-text-strong { color: #10b981; font-weight: 700; }

.password-checklist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.5rem;
  margin-top: 0.45rem;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

@media (max-width: 480px) {
  .password-checklist {
    grid-template-columns: 1fr;
  }
}

.criteria-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.73rem;
  color: #94a3b8;
  transition: all 0.2s ease;
}

.criteria-item i {
  font-size: 0.78rem;
  color: #64748b;
  transition: all 0.2s ease;
}

.criteria-item.met {
  color: #e2e8f0;
}

.criteria-item.met i {
  color: #10b981;
}

.pass-match-hint {
  font-size: 0.75rem;
  margin-top: 0.35rem;
  min-height: 1rem;
  font-weight: 600;
}
.pass-match-hint.error { color: #f43f5e; }
.pass-match-hint.success { color: #10b981; }

/* ==========================================================================
   APP PAGE ANIMATIONS (Smooth 60fps Entrance & Interactive Glows)
   ========================================================================== */
@keyframes heroEntrance {
  0% { opacity: 0; transform: translateY(18px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  50% { transform: scale(1.02); box-shadow: 0 0 12px 3px rgba(99, 102, 241, 0.3); }
}

@keyframes playerWrapperEntrance {
  0% { opacity: 0; transform: translateY(22px) scale(0.99); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulsePlayBtn {
  0% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.6); }
  70% { transform: translate(-50%, -50%) scale(1.06); box-shadow: 0 0 25px 8px rgba(99, 102, 241, 0); }
  100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

@keyframes cardPopEntrance {
  0% { opacity: 0; transform: scale(0.92) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes dotActivePulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 10px rgba(99, 102, 241, 0.8); }
  50% { transform: translate(-50%, -50%) scale(1.25); box-shadow: 0 0 20px rgba(56, 189, 248, 1); }
}

@keyframes trophyBounce {
  0% { transform: scale(0.4) rotate(-15deg); opacity: 0; }
  60% { transform: scale(1.15) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}

.hero-header {
  animation: heroEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-header .badge-tag {
  animation: badgePulse 3.5s infinite ease-in-out;
}

.player-wrapper {
  animation: playerWrapperEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.player-center-play:not(.hidden) {
  animation: pulsePlayBtn 2.2s infinite ease-in-out;
}

.interaction-tracker-bar {
  animation: cardPopEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

.interaction-step-dot.active {
  animation: dotActivePulse 1.8s infinite ease-in-out;
}

.scenario-card {
  animation: cardPopEntrance 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.scenario-card:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: 0 16px 35px -8px rgba(0, 0, 0, 0.6), 0 0 22px rgba(99, 102, 241, 0.4);
}

.mc-option-card {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mc-option-card:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-proceed {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.btn-proceed:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.45);
}

#completionOverlay .fa-trophy {
  animation: trophyBounce 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
