/* ===================================================
   LinguaQuest — Components CSS
   Reusable UI components
   =================================================== */

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1;
  padding: 12px 24px;
  border-radius: var(--radius-xl);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn i, .btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
  border-radius: var(--radius-lg);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1rem;
  border-radius: var(--radius-xl);
}

.btn-primary {
  background: var(--brand-primary);
  color: var(--brand-light);
  border-color: var(--brand-primary);
}

.btn-primary:hover {
  background: #163a54;
  border-color: #163a54;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-secondary:hover {
  background: var(--brand-primary);
  color: var(--brand-light);
}

.btn-accent {
  background: var(--brand-accent);
  color: var(--brand-dark);
  border-color: var(--brand-accent);
}

.btn-accent:hover {
  background: #e8924e;
  border-color: #e8924e;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--brand-primary);
  border-color: rgba(27, 73, 101, 0.3);
}

.btn-ghost:hover {
  background: rgba(27, 73, 101, 0.06);
  border-color: var(--brand-primary);
}

.btn-light {
  background: var(--brand-light);
  color: var(--brand-primary);
  border-color: var(--brand-light);
}

.btn-light:hover {
  background: var(--brand-surface);
  transform: translateY(-2px);
}

.btn-dark {
  background: var(--brand-dark);
  color: var(--brand-light);
  border-color: var(--brand-dark);
}

.btn-dark:hover {
  background: #0a1d2e;
}

.btn-loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spinner-rotate 0.8s linear infinite;
  margin-left: 8px;
}

.btn-icon {
  padding: 10px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
  padding: 6px;
}

.btn:disabled,
.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- CARDS --- */
.card {
  background: var(--brand-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-hover {
  cursor: pointer;
}

.card-header {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(107, 123, 141, 0.15);
}

.card-body { margin-bottom: 16px; }
.card-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(107, 123, 141, 0.15);
}

/* --- Language Card --- */
.card-language {
  position: relative;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: var(--shadow-card);
}

.card-language .lang-header {
  height: 8px;
  width: 100%;
}

.card-language .lang-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-language .lang-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 24px;
}

.card-language h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.card-language .lang-exam {
  font-size: 0.8125rem;
  color: var(--brand-muted);
  margin-bottom: 12px;
}

.card-language .lang-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.card-language .lang-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brand-primary);
  transition: gap var(--transition-fast);
  margin-top: auto;
}

.card-language:hover .lang-cta { gap: 10px; }

.card-language .card-hover-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  background: linear-gradient(to top, rgba(13, 37, 53, 0.85), transparent);
  display: flex;
  justify-content: space-between;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card-language:hover .card-hover-overlay { opacity: 1; }

.card-hover-overlay span {
  color: var(--brand-light);
  font-size: 0.8125rem;
}

/* --- Quiz Card --- */
.card-quiz {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-quiz .quiz-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--info-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
}

.card-quiz h4 { font-size: 1rem; font-weight: 600; }

.card-quiz .quiz-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--brand-muted);
}

.card-quiz .quiz-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- Stat Card --- */
.card-stat {
  text-align: center;
  padding: 24px 16px;
}

.card-stat .stat-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--brand-primary);
  line-height: 1;
  margin-bottom: 8px;
}

.card-stat .stat-label {
  font-size: 0.875rem;
  color: var(--brand-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-stat .stat-trend {
  font-size: 0.8125rem;
  margin-top: 8px;
}

.card-stat .stat-trend.up { color: var(--success); }
.card-stat .stat-trend.down { color: var(--error); }

/* --- Testimonial Card --- */
.card-testimonial {
  border-left: 4px solid var(--brand-accent);
  padding-left: 24px;
}

.card-testimonial .testimonial-quote {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-style: italic;
  color: var(--brand-dark);
  margin-bottom: 16px;
  line-height: 1.5;
}

.card-testimonial .testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-testimonial .author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--brand-light);
  font-size: 0.875rem;
}

.card-testimonial .author-info h5 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.card-testimonial .author-info span {
  font-size: 0.8125rem;
  color: var(--brand-muted);
}

.card-testimonial .stars {
  display: flex;
  gap: 2px;
  margin-top: 8px;
}

.card-testimonial .stars svg {
  width: 16px;
  height: 16px;
  fill: var(--brand-accent);
  stroke: var(--brand-accent);
}

/* --- FORM ELEMENTS --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brand-dark);
}

.form-label .required {
  color: var(--error);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--brand-dark);
  background: var(--brand-light);
  border: 2px solid rgba(107, 123, 141, 0.25);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--brand-secondary);
  box-shadow: 0 0 0 3px rgba(98, 182, 203, 0.2);
}

.form-input::placeholder {
  color: rgba(107, 123, 141, 0.6);
}

.form-input.error,
.form-select.error {
  border-color: var(--error);
}

.form-input.success {
  border-color: var(--success);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7B8D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-error {
  font-size: 0.8125rem;
  color: var(--error);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-error i { width: 14px; height: 14px; }

.form-success {
  font-size: 0.8125rem;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-success i { width: 14px; height: 14px; }

.form-help {
  font-size: 0.8125rem;
  color: var(--brand-muted);
}

.form-row {
  display: grid;
  gap: 16px;
}

.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Radio Card Group */
.form-radio-group {
  display: grid;
  gap: 12px;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 2px solid rgba(107, 123, 141, 0.25);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.radio-card:hover {
  border-color: var(--brand-secondary);
}

.radio-card.selected {
  border-color: var(--brand-primary);
  background: rgba(27, 73, 101, 0.04);
}

.radio-card input[type="radio"] {
  margin-top: 4px;
  accent-color: var(--brand-primary);
}

.radio-card-content { flex: 1; }

.radio-card-content h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.radio-card-content p {
  font-size: 0.8125rem;
  color: var(--brand-muted);
  margin: 0;
}

/* Checkbox */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

.form-check span {
  font-size: 0.875rem;
  color: var(--brand-dark);
}

/* --- BADGES + PILLS --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge-green {
  background: var(--success-bg);
  color: var(--success);
}

.badge-blue {
  background: var(--info-bg);
  color: var(--info);
}

.badge-orange {
  background: #FFF0E6;
  color: #E76F51;
}

.badge-red {
  background: var(--error-bg);
  color: var(--error);
}

.badge-gray {
  background: #E8ECF0;
  color: var(--brand-muted);
}

.badge-accent {
  background: #FFF3E0;
  color: var(--brand-accent);
}

.badge-dark {
  background: var(--brand-dark);
  color: var(--brand-light);
}

/* Level Badge (JLPT/CEFR) */
.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brand-light);
}

.level-badge.n5 { background: #2D6A4F; }
.level-badge.n4 { background: #1B4965; }
.level-badge.n3 { background: #003189; }
.level-badge.n2 { background: #E76F51; }
.level-badge.n1 { background: #C1121F; }

.level-badge.a1 { background: #2D6A4F; }
.level-badge.a2 { background: #1B4965; }
.level-badge.b1 { background: #003189; }
.level-badge.b2 { background: #E76F51; }
.level-badge.c1 { background: #C1121F; }
.level-badge.c2 { background: #6B1080; }

/* Tag */
.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(107, 123, 141, 0.1);
  color: var(--brand-muted);
}

/* --- NAVIGATION --- */

/* Fixed Nav */
.nav-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: rgba(248, 245, 239, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(107, 123, 141, 0.1);
  display: flex;
  align-items: center;
}

.nav-fixed .nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo-text {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.nav-tagline {
  font-size: 0.75rem;
  color: var(--brand-muted);
  border-left: 1px solid rgba(107, 123, 141, 0.3);
  padding-left: 10px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--brand-dark);
  text-decoration: none;
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand-accent);
  transition: width var(--transition-base);
}

.nav-links a:hover::after { width: 100%; }

.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobile Nav */
.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--brand-dark);
}

.nav-mobile-toggle i { width: 24px; height: 24px; }

@media (max-width: 768px) {
  .nav-fixed .nav-inner { padding: 0 16px; }
  .nav-links {
    display: none;
    z-index: 99;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--brand-surface);
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid rgba(107, 123, 141, 0.1);
    box-shadow: var(--shadow-card);
    animation: slideDown 0.25s ease;
  }
  .nav-links.open a {
    font-size: 1.0625rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    transition: background 0.2s;
  }
  .nav-links.open a:hover {
    background: rgba(27,73,101,0.06);
  }
  .nav-links.open a i { color: var(--brand-primary); }
  .nav-mobile-toggle { display: flex; }
  .nav-cta .btn span:not([data-lucide]) { display: none; }
  .nav-cta .btn i { margin-right: 0; }
  .nav-cta .btn { padding: 8px 12px; }
  .nav-logo .nav-tagline { display: none; }

  /* Footer mobile responsive */
  footer .grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
  }
  footer .grid > div:first-child {
    grid-column: 1 / -1;
  }
  footer .grid > div:last-child {
    grid-column: 1 / -1;
  }
  footer [style*="border-top"] {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  footer [style*="border-top"] p:last-child {
    text-align: center !important;
  }
}

/* --- Hero Section --- */
.hero-left { max-width: 560px; }
.hero-right { display: block; }

@media (max-width: 1024px) {
  .hero-right { display: none; }
  .hero-left { max-width: 100%; }
}

@media (max-width: 768px) {
  .section { --section-padding: 60px 16px; }
  .section-kicker { font-size: 0.8125rem; }
  h1 { font-size: clamp(1.75rem, 8vw, 2.5rem) !important; }
  .flex.gap-md { flex-direction: column; gap: 12px; }
  .flex.gap-md .btn { width: 100%; justify-content: center; }
  .badge { font-size: 0.8125rem !important; padding: 5px 10px !important; }
  .badge i { display: none; }
}

@media (max-width: 480px) {
  h1 { font-size: clamp(1.5rem, 9vw, 2rem) !important; }
  .section { --section-padding: 40px 12px; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--brand-muted);
  list-style: none;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb li:not(:last-child)::after {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--brand-muted);
  border-radius: 50%;
}

.breadcrumb a {
  color: var(--brand-muted);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover { color: var(--brand-primary); }
.breadcrumb .current { color: var(--brand-dark); font-weight: 500; }

/* Tab Bar */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid rgba(107, 123, 141, 0.15);
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar { display: none; }

.tab-bar button {
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--brand-muted);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color var(--transition-fast);
}

.tab-bar button::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-primary);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.tab-bar button:hover { color: var(--brand-dark); }

.tab-bar button.active {
  color: var(--brand-primary);
}

.tab-bar button.active::after {
  transform: scaleX(1);
}

/* Sidebar Nav */
.sidebar-nav {
  width: 240px;
  background: var(--brand-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--brand-dark);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.sidebar-nav-item i { width: 18px; height: 18px; color: var(--brand-muted); }

.sidebar-nav-item:hover,
.sidebar-nav-item.active {
  background: rgba(27, 73, 101, 0.06);
  color: var(--brand-primary);
}

.sidebar-nav-item:hover i,
.sidebar-nav-item.active i { color: var(--brand-primary); }

/* --- QUIZ-SPECIFIC COMPONENTS --- */

/* Quiz Option Button */
.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  background: var(--brand-light);
  border: 2px solid rgba(107, 123, 141, 0.25);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--brand-dark);
  transition: all var(--transition-fast);
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--brand-secondary);
  background: rgba(98, 182, 203, 0.05);
}

.quiz-option.selected {
  border-color: var(--brand-primary);
  background: rgba(27, 73, 101, 0.04);
}

.quiz-option.correct {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success);
}

.quiz-option.wrong {
  border-color: var(--error);
  background: var(--error-bg);
  color: var(--error);
}

.quiz-option:disabled { cursor: default; }

.quiz-option-marker {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
  background: none;
  color: inherit;
}

.quiz-option.correct .quiz-option-marker,
.quiz-option.wrong .quiz-option-marker {
  background: currentColor;
  color: var(--brand-light);
}

/* Progress Bar */
.quiz-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(107, 123, 141, 0.2);
  border-radius: 9999px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--brand-primary);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.quiz-progress-fill.fast { transition: width 0.15s ease; }

/* Timer Circle */
.quiz-timer {
  position: relative;
  width: 48px;
  height: 48px;
}

.quiz-timer svg {
  transform: rotate(-90deg);
}

.quiz-timer-track {
  fill: none;
  stroke: rgba(107, 123, 141, 0.2);
  stroke-width: 4;
}

.quiz-timer-fill {
  fill: none;
  stroke: var(--brand-primary);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}

.quiz-timer-fill.warning { stroke: var(--warning); }
.quiz-timer-fill.danger { stroke: var(--error); }

.quiz-timer-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-dark);
}

/* Audio Player */
.audio-player {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(27, 73, 101, 0.04);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(107, 123, 141, 0.15);
}

.audio-play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: var(--brand-light);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.audio-play-btn:hover {
  background: #163a54;
  transform: scale(1.05);
}

.audio-play-btn i { width: 20px; height: 20px; }

.audio-waveform {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 40px;
}

.audio-waveform-bar {
  width: 3px;
  background: var(--brand-secondary);
  border-radius: 2px;
  transition: height 0.15s ease;
}

.audio-waveform.playing .audio-waveform-bar {
  animation: wave-animate 0.8s ease-in-out infinite alternate;
}

@keyframes wave-animate {
  from { transform: scaleY(0.3); }
  to { transform: scaleY(1); }
}

.audio-progress {
  flex: 1;
  height: 4px;
  background: rgba(107, 123, 141, 0.2);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.audio-progress-fill {
  height: 100%;
  background: var(--brand-primary);
  border-radius: 2px;
  position: relative;
}

.audio-progress-fill::after {
  content: '';
  position: absolute;
  right: -6px;
  top: -4px;
  width: 12px;
  height: 12px;
  background: var(--brand-primary);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.audio-speed-btns {
  display: flex;
  gap: 4px;
}

.audio-speed-btn {
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(107, 123, 141, 0.3);
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  color: var(--brand-muted);
  transition: all var(--transition-fast);
}

.audio-speed-btn.active,
.audio-speed-btn:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-light);
}

.audio-replays {
  display: flex;
  gap: 4px;
  align-items: center;
}

.audio-replay-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-secondary);
}

.audio-replay-dot.used { background: rgba(107, 123, 141, 0.3); }

/* Question Image */
.question-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  cursor: zoom-in;
  transition: transform var(--transition-base);
}

.question-image:hover { transform: scale(1.01); }

/* Image Lightbox */
.image-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.image-lightbox.active { display: flex; }

.image-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-md);
}

.image-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--brand-light);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Score Circle */
.score-circle {
  width: 160px;
  height: 160px;
  position: relative;
}

.score-circle svg {
  transform: rotate(-90deg);
}

.score-circle-track {
  fill: none;
  stroke: rgba(107, 123, 141, 0.2);
  stroke-width: 8;
}

.score-circle-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s ease-out;
}

.score-circle-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-circle-text .score-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--brand-dark);
  line-height: 1;
}

.score-circle-text .score-label {
  font-size: 0.875rem;
  color: var(--brand-muted);
  margin-top: 4px;
}

/* Question Counter */
.question-counter {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--brand-muted);
}

.question-counter strong {
  color: var(--brand-dark);
}

/* --- MODALS --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 37, 53, 0.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}

.modal-overlay.active { display: flex; }

.modal-box {
  background: var(--brand-light);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-modal);
  max-height: 90vh;
  overflow-y: auto;
  animation: scale-in 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--brand-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.modal-close:hover { color: var(--brand-dark); background: rgba(107, 123, 141, 0.1); }
.modal-close i { width: 20px; height: 20px; }

.modal-body { margin-bottom: 24px; }
.modal-body p { color: var(--brand-dark); }

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* --- ALERTS + TOASTS --- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  border-left: 4px solid transparent;
}

.alert i { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success);
}

.alert-error {
  background: var(--error-bg);
  color: var(--error);
  border-color: var(--error);
}

.alert-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning);
}

.alert-info {
  background: var(--info-bg);
  color: var(--info);
  border-color: var(--info);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--brand-dark);
  color: var(--brand-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover);
  font-size: 0.9375rem;
  animation: slide-in-right 0.3s ease;
  max-width: 360px;
}

.toast i { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.warning { background: var(--warning); }

@keyframes slide-in-right {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* --- LOADING STATES --- */
.skeleton {
  background: linear-gradient(90deg, #e8ecf0 25%, #d5dce3 50%, #e8ecf0 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-text:last-child { width: 60%; }

.skeleton-title {
  height: 28px;
  width: 40%;
  margin-bottom: 16px;
}

.skeleton-circle {
  border-radius: 50%;
}

/* Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(107, 123, 141, 0.2);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spinner-rotate 0.8s linear infinite;
}

.spinner-lg { width: 40px; height: 40px; border-width: 4px; }

/* Progress Ring */
.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-track {
  fill: none;
  stroke: rgba(107, 123, 141, 0.15);
}

.progress-ring-fill {
  fill: none;
  stroke: var(--brand-primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

/* --- DIVIDERS --- */
.divider {
  width: 100%;
  height: 1px;
  background: rgba(107, 123, 141, 0.15);
  margin: 32px 0;
}

.divider-accent {
  width: 60px;
  height: 4px;
  background: var(--brand-accent);
  border-radius: 2px;
  margin: 16px 0;
}

/* Section Kicker */
.section-kicker {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(244, 162, 97, 0.15);
  color: var(--brand-accent);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--brand-dark);
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 1.0625rem;
  color: var(--brand-muted);
  max-width: 600px;
  margin-bottom: 48px;
}

.section-title-center {
  text-align: center;
}

.section-title-center .section-subtitle {
  margin: 12px auto 48px;
}

/* --- RESPONSIVE UTILITIES --- */
@media (max-width: 768px) {
  .card { padding: 18px; }
  .card-stat .stat-number { font-size: 2rem; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .modal-box { padding: 24px 20px; }
  .modal-footer { flex-direction: column; }
  .modal-footer .btn { width: 100%; }
  .audio-player { flex-wrap: wrap; }
  .audio-waveform { order: 10; width: 100%; display: none; }
  .audio-player.playing .audio-waveform { display: flex; }
  .score-circle { width: 120px; height: 120px; }
  .score-circle-text .score-value { font-size: 1.75rem; }
}