/* =========================================================
   LinguaLab — A Preply-inspired language learning platform
   Modern, glassy, gradient-rich, with delightful motion
   ========================================================= */

:root {
  /* Brand */
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-300: #a5b4fc;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;

  --accent-300: #fda4af;
  --accent-500: #f43f5e;
  --accent-600: #e11d48;

  --mint-400: #2dd4bf;
  --amber-400: #fbbf24;

  /* Surfaces (light) */
  --bg: #f6f7fb;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f4f8;
  --surface-elev: rgba(255,255,255,0.72);
  --border: rgba(15,23,42,0.08);
  --border-strong: rgba(15,23,42,0.16);
  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --shadow-md: 0 8px 24px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.05);
  --shadow-lg: 0 28px 60px -20px rgba(79,70,229,.30), 0 12px 24px -12px rgba(15,23,42,.18);
  --shadow-glow: 0 0 0 4px rgba(99,102,241,.12), 0 30px 60px -20px rgba(99,102,241,.45);

  --gradient-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --gradient-cool:  linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
  --gradient-warm:  linear-gradient(135deg, #f59e0b 0%, #ef4444 60%, #ec4899 100%);
  --gradient-aurora: radial-gradient(60% 80% at 20% 10%, rgba(99,102,241,.35), transparent 60%),
                     radial-gradient(50% 70% at 90% 0%, rgba(236,72,153,.25), transparent 60%),
                     radial-gradient(60% 90% at 50% 100%, rgba(45,212,191,.25), transparent 60%);
  --grid-color: rgba(15,23,42,.06);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --tx: cubic-bezier(.2,.8,.2,1);
}

html[data-theme="dark"] {
  --bg: #07091a;
  --bg-soft: #0b1024;
  --surface: #111733;
  --surface-2: #18204a;
  --surface-elev: rgba(17,23,51,.72);
  --border: rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.18);
  --text: #f8fafc;
  --text-soft: #cbd5e1;
  --text-muted: #94a3b8;
  --grid-color: rgba(255,255,255,.05);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 12px 30px rgba(0,0,0,.45);
  --shadow-lg: 0 28px 60px -10px rgba(99,102,241,.45), 0 12px 24px -12px rgba(0,0,0,.55);
  --shadow-glow: 0 0 0 4px rgba(139,92,246,.18), 0 36px 72px -20px rgba(139,92,246,.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  overflow-x: hidden;
  position: relative;
}

/* Subtle global grid + noise overlay for premium feel */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: -2;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

[lang="en"] {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Layout ---------- */
.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

.section {
  padding: 96px 0;
  position: relative;
}
.section-title {
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid color-mix(in srgb, var(--brand-500) 20%, transparent);
}
html[data-theme="dark"] .section-eyebrow {
  background: rgba(99,102,241,.15);
  color: #c7d2fe;
}
.section-sub {
  color: var(--text-soft);
  font-size: 17px;
  max-width: 640px;
  margin: 0 0 40px;
}

/* Gradient-text helper (with glow) */
.grad {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  position: relative;
  display: inline-block;
}
.grad::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 10px;
  background: var(--gradient-brand);
  filter: blur(14px);
  opacity: .35;
  border-radius: 999px;
}

/* ---------- Buttons ---------- */
.btn {
  --h: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--h);
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid transparent;
  transition: transform .25s var(--tx), box-shadow .25s var(--tx), background .2s, color .2s, border-color .2s;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(99,102,241,.7);
}
/* Shine sweep on hover */
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  height: 100%; width: 60%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg);
  transition: left .7s var(--tx);
}
.btn-primary:hover::after { left: 130%; }
.btn-primary:hover { box-shadow: 0 18px 36px -14px rgba(236,72,153,.6); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft {
  background: var(--brand-50);
  color: var(--brand-700);
}
html[data-theme="dark"] .btn-soft { background: rgba(99,102,241,.15); color: #c7d2fe; }
.btn-soft:hover { filter: brightness(.97); }
.btn-lg { --h: 52px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 40px; height: 40px; padding: 0; border-radius: 12px;
  display: inline-grid; place-items: center;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
}
.btn-icon:hover { background: var(--brand-50); color: var(--brand-700); }
html[data-theme="dark"] .btn-icon:hover { background: rgba(99,102,241,.15); color: #c7d2fe; }

/* Language pill */
.lang-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-weight: 700; font-size: 13px; color: var(--text);
  transition: all .2s;
  font-variant-numeric: tabular-nums;
}
.lang-pill:hover { background: var(--brand-50); color: var(--brand-700); }
html[data-theme="dark"] .lang-pill:hover { background: rgba(99,102,241,.18); color: #c7d2fe; }
.lang-pill svg { opacity: .7; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
  transition: background .25s, border-color .25s;
}
.nav {
  display: flex; align-items: center; gap: 24px;
  height: 72px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px; letter-spacing: -0.01em;
}
.logo-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--gradient-brand);
  display: grid; place-items: center;
  color: white; font-weight: 800;
  box-shadow: 0 10px 22px -8px rgba(99,102,241,.7);
  transform: rotate(-6deg);
  position: relative;
  overflow: hidden;
}
.logo-mark::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.5) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shine 4s var(--tx) infinite;
}
@keyframes shine { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(120%); } }
.logo-mark::after { content: "L"; font-family: "Inter", sans-serif; position: relative; }
.nav-links {
  display: flex; gap: 4px; align-items: center;
  margin-left: 18px;
}
.nav-link {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  color: var(--text-soft);
  font-weight: 500;
  transition: background .2s, color .2s;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface-2); }
.nav-spacer { flex: 1; }
.nav-actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: inline; }
html[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 80px 0 60px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -10% -10% auto -10%;
  height: 90%;
  background: var(--gradient-aurora);
  filter: blur(20px);
  z-index: -1;
  animation: aurora 18s ease-in-out infinite alternate;
}
@keyframes aurora {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(2%, -1%, 0) scale(1.06); }
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 64px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 18px 0 18px;
}
.hero p.lead {
  color: var(--text-soft);
  font-size: 18px;
  max-width: 560px;
}
.hero-stats {
  display: flex; gap: 28px; margin-top: 28px;
}
.hero-stats .stat strong {
  display: block; font-size: 26px; font-weight: 800; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.hero-stats .stat span { color: var(--text-soft); font-size: 13px; }

/* Search box in hero */
.searchbox {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 8px;
  box-shadow: var(--shadow-md);
  transition: box-shadow .3s var(--tx), transform .3s var(--tx);
}
.searchbox:focus-within { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.searchbox .field {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 12px;
  background: var(--surface-2);
}
.searchbox .field svg { flex: 0 0 18px; color: var(--text-muted); }
.searchbox select, .searchbox input {
  border: 0; outline: none; background: transparent; color: var(--text);
  font-size: 15px; width: 100%; font-family: inherit;
}
.searchbox select option { color: #0f172a; }

/* ---------- Hero visual: collage of tutor avatars ---------- */
.hero-visual {
  position: relative;
  height: 520px;
}
.hero-orb {
  position: absolute;
  inset: 0;
  background: var(--gradient-brand);
  border-radius: 50%;
  width: 360px; height: 360px;
  margin: auto;
  filter: blur(0px);
  box-shadow: 0 40px 80px -20px rgba(99,102,241,.55);
  animation: float 7s var(--tx) infinite alternate;
  opacity: .9;
}
.hero-orb::before {
  content: "";
  position: absolute; inset: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.4), transparent 45%);
}
@keyframes float {
  0% { transform: translateY(-6px) rotate(-2deg); }
  100% { transform: translateY(8px) rotate(3deg); }
}
.float-card {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 14px 10px 10px;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 10px;
  min-width: 180px;
  animation: bob 6s ease-in-out infinite;
  z-index: 2;
}
.float-card .avatar-img {
  width: 42px; height: 42px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--gradient-brand);
}
.float-card .meta { display: flex; flex-direction: column; }
.float-card .meta strong { font-size: 13.5px; }
.float-card .meta span { font-size: 11.5px; color: var(--text-soft); }
.float-card .live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6);
  animation: pulse 1.8s infinite;
  margin-right: 4px;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); }
  70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.float-card.fc1 { top: 10px;  left: 0;     animation-delay: -1s;   }
.float-card.fc2 { top: 130px; right: 0;    animation-delay: -2.5s; }
.float-card.fc3 { bottom: 30px; left: 20px; animation-delay: -4s;  }
.float-card.fc4 { bottom: 100px; right: 30px; animation-delay: -3s; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.float-flag {
  position: absolute;
  width: 56px; height: 56px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 28px;
  box-shadow: var(--shadow-md);
  animation: bob 5s ease-in-out infinite;
}
.float-flag.f1 { top: 60px;  right: 30%; animation-delay: -1.5s; }
.float-flag.f2 { bottom: 60px; right: 50%; animation-delay: -2.2s; }
.float-flag.f3 { top: 50%;   left: 0;     animation-delay: -3.4s; }

/* Marquee for trusted companies */
.marquee {
  margin-top: 60px;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex; gap: 48px;
  width: max-content;
  animation: marquee 40s linear infinite;
  opacity: .75;
}
.marquee-item {
  font-weight: 700; letter-spacing: .3em;
  font-size: 14px; color: var(--text-soft);
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- Languages ---------- */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.lang-card {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform .35s var(--tx), box-shadow .35s var(--tx), border-color .25s;
  overflow: hidden;
}
.lang-card::before {
  content: "";
  position: absolute; right: -40px; top: -40px;
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--gradient-brand);
  opacity: .08;
  transition: transform .5s var(--tx), opacity .3s;
}
.lang-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.lang-card:hover::before { transform: scale(1.5); opacity: .14; }
.lang-flag {
  font-size: 38px; line-height: 1;
}
.lang-name { font-weight: 700; font-size: 17px; }
.lang-tutors { color: var(--text-soft); font-size: 13.5px; }
.lang-cta {
  margin-top: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--brand-600);
  display: inline-flex; align-items: center; gap: 4px;
  opacity: 0; transform: translateX(-6px);
  transition: opacity .25s, transform .25s var(--tx);
}
.lang-card:hover .lang-cta { opacity: 1; transform: translateX(0); }

/* ---------- Tutor cards ---------- */
.tutor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}
.tutor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: transform .35s var(--tx), box-shadow .35s var(--tx), border-color .25s;
  display: flex; flex-direction: column; gap: 14px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
/* Aurora glow on hover */
.tutor-card::before {
  content: "";
  position: absolute; inset: -1px;
  background: var(--gradient-brand);
  z-index: -1;
  border-radius: inherit;
  opacity: 0;
  transition: opacity .3s;
}
.tutor-card:hover::before { opacity: 1; }
.tutor-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.tutor-card .inner {
  background: var(--surface);
  border-radius: inherit;
  margin: -1px;
  padding: 19px;
  display: flex; flex-direction: column; gap: 12px;
  height: 100%;
}

/* Photo + identity row */
.tutor-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #c7d2fe, #fbcfe8);
}
.tutor-photo-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s var(--tx);
}
.tutor-card:hover .tutor-photo-wrap img { transform: scale(1.06); }
.tutor-photo-wrap .flag-corner {
  position: absolute; top: 10px; left: 10px;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  font-size: 18px;
  box-shadow: 0 6px 14px rgba(0,0,0,.18);
}
.tutor-photo-wrap .badge-corner {
  position: absolute; top: 10px; right: 10px;
  padding: 5px 10px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 11.5px; font-weight: 700;
  border-radius: 999px;
  letter-spacing: .02em;
}
.tutor-photo-wrap .live-dot {
  position: absolute; bottom: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 11.5px; font-weight: 600;
  border-radius: 999px;
}
.tutor-photo-wrap .live-dot::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,.6);
  animation: pulse 1.8s infinite;
}
.tutor-photo-wrap .play-btn {
  position: absolute; right: 12px; bottom: 12px;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.92);
  display: grid; place-items: center;
  font-size: 12px; color: #0f172a;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
  transition: transform .25s;
}
.tutor-card:hover .tutor-photo-wrap .play-btn { transform: scale(1.1); }

.tutor-id-row {
  display: flex; align-items: center; gap: 12px;
}
.tutor-name {
  font-size: 17px; font-weight: 700; margin: 0;
  display: flex; align-items: center; gap: 6px;
}
.tutor-tag { font-size: 13px; color: var(--text-soft); }
.tutor-rating {
  display: flex; align-items: center; gap: 6px;
  font-size: 13.5px;
  margin-left: auto;
}
.tutor-rating strong { font-size: 14.5px; }
.tutor-rating .reviews { color: var(--text-muted); font-size: 12.5px; }

.tutor-bio {
  font-size: 14px;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.tutor-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.chip {
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-soft);
}
.chip.primary {
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(236,72,153,.12));
  color: var(--brand-700);
  border: 1px solid color-mix(in srgb, var(--brand-500) 22%, transparent);
}
html[data-theme="dark"] .chip.primary { color: #e9d5ff; }
.tutor-bottom {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.tutor-price strong { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.tutor-price span { color: var(--text-muted); font-size: 12px; }
.tutor-actions { display: flex; gap: 8px; }

/* ---------- How it works ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  position: relative;
}
.step {
  position: relative;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .35s var(--tx), box-shadow .35s var(--tx);
}
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.step .num {
  position: absolute;
  top: 18px; right: 22px;
  font-size: 80px; font-weight: 900;
  background: var(--gradient-brand);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  opacity: .25;
  line-height: 1;
}
.step h3 { margin: 8px 0 8px; font-size: 20px; }
.step p { color: var(--text-soft); margin: 0; font-size: 14.5px; }
.step .icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--brand-50); color: var(--brand-700);
  display: grid; place-items: center;
  margin-bottom: 6px;
  font-size: 22px;
}
html[data-theme="dark"] .step .icon { background: rgba(99,102,241,.18); color: #c7d2fe; }

/* ---------- Testimonials ---------- */
.testimonials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.testimonial {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  display: flex; flex-direction: column; gap: 16px;
  transition: transform .35s var(--tx), box-shadow .35s var(--tx), border-color .25s;
  overflow: hidden;
  isolation: isolate;
}
.testimonial::before {
  content: "“";
  position: absolute; top: 12px; right: 22px;
  font-size: 92px; color: var(--brand-300); opacity: .38;
  font-family: Georgia, serif; line-height: 1;
  z-index: 0;
}
/* Aurora gradient halo on hover */
.testimonial::after {
  content: "";
  position: absolute; inset: -1px;
  background: var(--gradient-brand);
  border-radius: inherit;
  z-index: -2;
  opacity: 0;
  transition: opacity .35s var(--tx);
}
.testimonial:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.testimonial:hover::after { opacity: 1; }

.testimonial .stars {
  color: #f59e0b;
  font-size: 16px;
  letter-spacing: 2px;
  position: relative;
}
.testimonial .quote {
  margin: 0;
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.65;
  position: relative;
  z-index: 1;
  flex: 1;
}
.testimonial .who {
  display: flex; align-items: center; gap: 14px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  position: relative;
}
.testimonial .who .ava-wrap {
  position: relative;
  width: 52px; height: 52px;
  flex: 0 0 auto;
}
.testimonial .who .ava-wrap::before {
  content: "";
  position: absolute; inset: -3px;
  background: var(--gradient-brand);
  border-radius: 50%;
  z-index: 0;
  opacity: .85;
  filter: blur(0.5px);
}
.testimonial .who .ava {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--gradient-brand);
  z-index: 1;
  border: 2px solid var(--surface);
}
.testimonial .who .ava img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.testimonial .who .flag-mini {
  position: absolute;
  right: -4px; bottom: -2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface);
  display: grid; place-items: center;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  z-index: 2;
  border: 2px solid var(--surface);
}
.testimonial .who .info { flex: 1; min-width: 0; }
.testimonial .who strong { display: block; font-size: 14.5px; }
.testimonial .who span { color: var(--text-muted); font-size: 12.5px; }
.testimonial .who .learning {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(236,72,153,.12));
  color: var(--brand-700);
  font-size: 11px;
  font-weight: 600;
}
html[data-theme="dark"] .testimonial .who .learning { color: #c7d2fe; }

/* ---------- CTA banner ---------- */
.cta {
  margin-top: 40px;
  border-radius: var(--radius-xl);
  padding: 60px;
  position: relative;
  overflow: hidden;
  background: var(--gradient-brand);
  color: white;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: center;
}
.cta::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(40% 60% at 80% 20%, rgba(255,255,255,.18), transparent 60%),
    radial-gradient(50% 50% at 0% 100%, rgba(0,0,0,.18), transparent 60%);
}
.cta h2 {
  position: relative;
  font-size: clamp(24px, 3vw, 36px);
  margin: 0 0 12px;
  letter-spacing: -.02em;
}
.cta p { position: relative; opacity: .95; margin: 0 0 20px; }
.cta .btn { background: #fff; color: #4338ca; }
.cta .btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(0,0,0,.25); }
.cta .right {
  position: relative;
  height: 200px;
  display: grid; place-items: center;
}
.cta .right .float-flag {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.3);
  position: absolute;
}
.cta .right .float-flag.f1 { top: 10px; left: 8%; }
.cta .right .float-flag.f2 { top: 60%; left: 30%; }
.cta .right .float-flag.f3 { top: 20%; right: 8%; }
.cta .right .float-flag.f4 { bottom: 0; right: 30%; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 80px;
  padding: 60px 0 30px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-soft);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 40px;
}
.foot-grid h4 { color: var(--text); margin: 0 0 14px; font-size: 14px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.foot-grid a { font-size: 14px; }
.foot-grid a:hover { color: var(--text); }
.foot-bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(8,12,30,.55);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: fade .25s var(--tx);
}
.modal-backdrop.open { display: flex; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.modal {
  width: min(440px, 100%);
  background: var(--surface);
  border-radius: 22px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  position: relative;
  animation: pop .3s var(--tx);
  overflow: hidden;
}
.modal::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(60% 40% at 50% 0%, rgba(99,102,241,.2), transparent 60%);
  pointer-events: none;
}
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.98) } to { opacity: 1; transform: none } }

.modal h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.01em; position: relative; }
.modal .sub { color: var(--text-soft); margin: 0 0 22px; font-size: 14.5px; position: relative; }
.modal .field-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; position: relative; }
.modal label { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.modal input {
  height: 44px; padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px; outline: none;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
.modal input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(99,102,241,.15);
}
.modal .switch-line {
  text-align: center; font-size: 14px; color: var(--text-soft); margin-top: 16px;
  position: relative;
}
.modal .switch-line a { color: var(--brand-600); font-weight: 600; cursor: pointer; }
.modal .close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2); border: 0; color: var(--text);
  z-index: 2;
}
.modal .social-row { display: flex; gap: 8px; margin-top: 14px; }
.modal .social-row .btn { flex: 1; }
.modal .divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 12px; margin: 18px 0;
  position: relative;
}
.modal .divider::before, .modal .divider::after {
  content: ""; height: 1px; background: var(--border); flex: 1;
}
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(40px);
  background: var(--surface); border: 1px solid var(--border);
  padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-md);
  z-index: 200; font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s var(--tx);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-left: 3px solid #22c55e; }
.toast.error { border-left: 3px solid #ef4444; }

/* ---------- Tutors page ---------- */
.page-hero {
  padding: 60px 0 30px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute; inset: -10% -10% auto -10%;
  height: 70%;
  background: var(--gradient-aurora);
  filter: blur(40px);
  z-index: -1;
  opacity: .8;
}
.page-hero h1 {
  font-size: clamp(32px, 4vw, 48px);
  margin: 8px 0 6px;
  letter-spacing: -.02em;
}
.page-hero p { color: var(--text-soft); margin: 0; }

.layout-2col {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  margin-top: 30px;
}

.filter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: sticky;
  top: 90px;
  height: fit-content;
}
.filter-card h3 {
  margin: 0 0 6px; font-size: 18px;
}
.filter-card .filter-block { margin-top: 18px; }
.filter-card label.row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px; font-size: 14px; cursor: pointer;
  color: var(--text-soft);
}
.filter-card input[type=checkbox] { accent-color: var(--brand-600); width: 16px; height: 16px; }
.filter-card .price-range {
  display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--text-soft);
}
.filter-card input[type=range] { accent-color: var(--brand-600); width: 100%; }

.tutors-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.tutors-toolbar .count { color: var(--text-soft); font-size: 14px; }
.tutors-toolbar select {
  height: 40px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-size: 14px;
}

/* ---------- Tutor detail ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  margin-top: 30px;
}
.detail-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.detail-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  align-items: center;
}
.detail-head .photo-large {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-md);
}
.detail-head .photo-large img {
  width: 100%; height: 100%; object-fit: cover;
}
.detail-head .photo-large .flag-corner {
  position: absolute; top: 10px; left: 10px;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.92);
  display: grid; place-items: center;
  font-size: 18px;
  box-shadow: 0 6px 14px rgba(0,0,0,.18);
}
.detail-head h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -.01em; }
.detail-head .meta {
  color: var(--text-soft);
  display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px;
  align-items: center;
}

.detail-video {
  margin-top: 22px;
  aspect-ratio: 16/9;
  width: 100%;
  border-radius: 16px;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  position: relative;
  overflow: hidden;
}
.detail-video::after {
  content: "▶";
  position: absolute; inset: 0; margin: auto;
  width: 70px; height: 70px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: #1e1b4b;
  display: grid; place-items: center; font-size: 22px;
}

.section-block { margin-top: 26px; }
.section-block h3 { margin: 0 0 10px; font-size: 18px; }
.section-block p { color: var(--text-soft); margin: 0; }

.review-list { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.review {
  display: flex; gap: 12px;
  padding: 14px; background: var(--surface-2); border-radius: 14px;
}
.review .ava { width: 42px; height: 42px; border-radius: 50%; background: var(--gradient-brand); flex: 0 0 auto; }
.review .body { flex: 1; }
.review .body header { display: flex; gap: 8px; align-items: center; }
.review .body header strong { font-size: 14.5px; }
.review .body header span { color: var(--text-muted); font-size: 12px; }

.book-card {
  position: sticky; top: 90px; height: fit-content;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
}
.book-card .price { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.book-card .price span { font-size: 14px; color: var(--text-soft); font-weight: 500; }
.book-card .calendar {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; margin-top: 16px;
}
.cal-cell {
  aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
  transition: background .2s, color .2s, transform .15s;
  user-select: none;
}
.cal-cell.head { background: transparent; cursor: default; font-weight: 700; color: var(--text-muted); font-size: 11px; }
.cal-cell:not(.head):not(.disabled):hover { background: var(--brand-50); color: var(--brand-700); transform: scale(1.05); }
html[data-theme="dark"] .cal-cell:not(.head):not(.disabled):hover { background: rgba(99,102,241,.2); color: #c7d2fe; }
.cal-cell.disabled { opacity: .3; cursor: not-allowed; }
.cal-cell.selected { background: var(--gradient-brand); color: #fff; }
.cal-cell.has-slots::after {
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--brand-500); margin-top: 2px;
}
.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.slot {
  padding: 8px; text-align: center;
  background: var(--surface-2); border-radius: 10px;
  font-size: 13px; cursor: pointer;
  border: 1px solid transparent;
  transition: all .2s;
}
.slot:hover { border-color: var(--brand-500); }
.slot.selected { background: var(--gradient-brand); color: #fff; }

/* ---------- Dashboard ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  margin-top: 30px;
}
.dash-side {
  position: sticky; top: 90px; height: fit-content;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.dash-user {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: 12px;
  background: var(--surface-2);
  margin-bottom: 12px;
}
.dash-user .ava { width: 44px; height: 44px; border-radius: 50%; background: var(--gradient-brand); display: grid; place-items: center; color: #fff; font-weight: 700; }
.dash-user .info strong { display: block; font-size: 14px; }
.dash-user .info span { color: var(--text-soft); font-size: 12px; }
.dash-nav { display: flex; flex-direction: column; gap: 4px; }
.dash-nav a {
  padding: 10px 12px; border-radius: 10px;
  font-size: 14px; color: var(--text-soft); display: flex; align-items: center; gap: 10px;
}
.dash-nav a.active, .dash-nav a:hover { color: var(--text); background: var(--surface-2); }

.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  position: relative; overflow: hidden;
}
.kpi::before {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--gradient-brand); opacity: .12;
}
.kpi .label { color: var(--text-soft); font-size: 13px; }
.kpi .val { font-size: 26px; font-weight: 800; letter-spacing: -.01em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .delta { color: #16a34a; font-size: 12px; margin-top: 4px; }

.dash-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px;
  margin-bottom: 18px;
}
.dash-section h3 { margin: 0 0 14px; font-size: 18px; }
.lesson-row {
  display: grid; grid-template-columns: 1fr 1.2fr 1fr auto;
  gap: 14px; align-items: center;
  padding: 14px; border-radius: 12px;
  background: var(--surface-2);
  margin-bottom: 8px;
}
.lesson-row .who { display: flex; gap: 10px; align-items: center; }
.lesson-row .who .ava {
  width: 40px; height: 40px; border-radius: 12px;
  overflow: hidden; flex: 0 0 auto;
  background: var(--gradient-brand);
}
.lesson-row .who .ava img { width: 100%; height: 100%; object-fit: cover; }
.lesson-row .when strong { display: block; font-size: 14px; }
.lesson-row .when span { color: var(--text-soft); font-size: 12.5px; }
.lesson-row .topic { font-size: 14px; color: var(--text-soft); }
.lesson-row .badge {
  font-size: 12px; padding: 5px 10px; border-radius: 999px;
  background: rgba(34,197,94,.12); color: #16a34a; font-weight: 600;
}
.lesson-row .badge.warn { background: rgba(251,191,36,.15); color: #b45309; }

/* ---------- Live chat widget (right-bottom) ---------- */
.chat-fab {
  position: fixed;
  z-index: 95;
  right: 24px;
  bottom: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 0;
  background: var(--gradient-brand);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow:
    0 18px 40px -10px rgba(99,102,241,.55),
    0 8px 18px -8px rgba(236,72,153,.45),
    inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .3s var(--tx), box-shadow .3s var(--tx), opacity .3s, background .3s;
  animation: fabIn .6s var(--tx) both;
}
.chat-fab:hover { transform: translateY(-3px) scale(1.05); }
.chat-fab:active { transform: scale(.96); }
@keyframes fabIn {
  from { opacity: 0; transform: translateY(40px) scale(.6); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* Pulsing aura ring */
.chat-fab::before {
  content: "";
  position: absolute; inset: -6px;
  border-radius: 50%;
  background: var(--gradient-brand);
  opacity: .35;
  z-index: -1;
  animation: fabPulse 2.4s var(--tx) infinite;
}
@keyframes fabPulse {
  0%   { transform: scale(.85); opacity: .55; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}
.chat-fab svg { width: 26px; height: 26px; }
.chat-fab .badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 18px; height: 18px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid; place-items: center;
  padding: 0 5px;
  border: 2px solid var(--bg);
  animation: pulse 1.8s infinite;
}
.chat-fab.open { transform: rotate(90deg) scale(.85); }
.chat-fab.open .badge { display: none; }

/* Chat panel */
.chat-panel {
  position: fixed;
  z-index: 94;
  right: 24px;
  bottom: 100px;
  width: min(380px, calc(100vw - 48px));
  height: min(560px, calc(100vh - 140px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow:
    0 30px 60px -15px rgba(15,23,42,.4),
    0 12px 28px -10px rgba(99,102,241,.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(.94);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: transform .35s var(--tx), opacity .25s var(--tx);
}
.chat-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
html[data-theme="dark"] .chat-panel {
  box-shadow:
    0 30px 60px -10px rgba(0,0,0,.7),
    0 12px 28px -10px rgba(139,92,246,.4);
}

.chat-header {
  position: relative;
  padding: 18px 18px 16px;
  background: var(--gradient-brand);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}
.chat-header::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 80% at 0% 0%, rgba(255,255,255,.18), transparent 60%),
    radial-gradient(60% 80% at 100% 100%, rgba(0,0,0,.15), transparent 60%);
  pointer-events: none;
}
.chat-avatar {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fde68a, #f9a8d4);
  display: grid; place-items: center;
  font-size: 22px;
  flex: 0 0 auto;
  border: 2px solid rgba(255,255,255,.5);
}
.chat-avatar::after {
  content: "";
  position: absolute;
  right: -2px; bottom: -2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(34,197,94,.6);
  animation: pulse 1.8s infinite;
}
.chat-meta { flex: 1; min-width: 0; position: relative; z-index: 1; }
.chat-meta strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.005em;
}
.chat-meta span {
  display: block;
  font-size: 12px;
  opacity: .85;
  line-height: 1.4;
}
.chat-close {
  position: relative;
  z-index: 1;
  width: 32px; height: 32px;
  border-radius: 10px;
  border: 0;
  background: rgba(255,255,255,.18);
  color: #fff;
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 16px;
  transition: background .2s;
}
.chat-close:hover { background: rgba(255,255,255,.3); }

.chat-body {
  flex: 1;
  padding: 18px 16px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, var(--surface), var(--surface-2));
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }

.chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  animation: msgIn .35s var(--tx) both;
  word-wrap: break-word;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-msg.bot {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 2px 6px rgba(15,23,42,.04);
}
.chat-msg.me {
  background: var(--gradient-brand);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.chat-time {
  font-size: 10.5px;
  color: var(--text-muted);
  align-self: center;
  margin: 4px 0;
}

.chat-typing {
  align-self: flex-start;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  animation: msgIn .25s var(--tx);
}
.chat-typing .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing 1.2s var(--tx) infinite;
}
.chat-typing .dot:nth-child(2) { animation-delay: .15s; }
.chat-typing .dot:nth-child(3) { animation-delay: .3s; }
@keyframes typing {
  0%, 60%, 100% { transform: scale(.6); opacity: .4; }
  30% { transform: scale(1); opacity: 1; }
}

.chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 14px 0;
}
.chat-quick button {
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--brand-700);
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
html[data-theme="dark"] .chat-quick button { color: #c7d2fe; background: var(--surface-2); }
.chat-quick button:hover {
  background: var(--brand-50);
  border-color: var(--brand-500);
  transform: translateY(-1px);
}
html[data-theme="dark"] .chat-quick button:hover { background: rgba(99,102,241,.18); }

.chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.chat-input input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.chat-input input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.chat-input button {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--gradient-brand);
  color: #fff;
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform .2s, box-shadow .2s;
  flex: 0 0 auto;
}
.chat-input button:hover { transform: scale(1.08) rotate(-8deg); box-shadow: 0 6px 14px -4px rgba(99,102,241,.5); }
.chat-input button:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

@media (max-width: 600px) {
  .chat-panel {
    right: 12px;
    bottom: 84px;
    width: calc(100vw - 24px);
    height: calc(100vh - 110px);
  }
  .chat-fab { right: 16px; bottom: 16px; }
}

/* ---------- Cookie consent banner ---------- */
.cookie-banner {
  position: fixed;
  z-index: 90;
  left: 24px;
  bottom: 24px;
  width: min(440px, calc(100vw - 48px));
  background: var(--surface-elev);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: 22px 22px 18px;
  box-shadow:
    0 30px 60px -20px rgba(15,23,42,.35),
    0 12px 28px -10px rgba(99,102,241,.25),
    inset 0 1px 0 rgba(255,255,255,.4);
  transform: translateY(calc(100% + 40px)) scale(.96);
  opacity: 0;
  transition: transform .55s var(--tx), opacity .35s var(--tx);
  overflow: hidden;
  isolation: isolate;
}
.cookie-banner.in {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.cookie-banner.expanded { width: min(520px, calc(100vw - 48px)); }
/* Aurora wash behind */
.cookie-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 80% at 0% 0%, rgba(99,102,241,.18), transparent 60%),
    radial-gradient(70% 80% at 100% 100%, rgba(236,72,153,.16), transparent 60%);
  z-index: -1;
  pointer-events: none;
}
html[data-theme="dark"] .cookie-banner {
  box-shadow:
    0 30px 60px -10px rgba(0,0,0,.65),
    0 12px 28px -10px rgba(139,92,246,.4),
    inset 0 1px 0 rgba(255,255,255,.06);
}

.cookie-banner .cb-head {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 10px;
}
.cookie-banner .cb-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--gradient-warm);
  display: grid; place-items: center;
  font-size: 22px;
  flex: 0 0 auto;
  box-shadow: 0 8px 18px -6px rgba(245,158,11,.55);
  position: relative;
  animation: cookieWiggle 4s var(--tx) infinite;
}
@keyframes cookieWiggle {
  0%, 92%, 100% { transform: rotate(0); }
  94% { transform: rotate(-12deg); }
  96% { transform: rotate(10deg); }
  98% { transform: rotate(-4deg); }
}
.cookie-banner .cb-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.cookie-banner .cb-desc {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}
.cookie-banner .cb-desc a {
  color: var(--brand-600);
  font-weight: 600;
  border-bottom: 1px solid currentColor;
}
html[data-theme="dark"] .cookie-banner .cb-desc a { color: #c7d2fe; }

.cookie-banner .cb-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.cookie-banner .cb-actions .btn { flex: 1; min-width: 110px; }
.cookie-banner .cb-actions .btn-link {
  background: none;
  border: 0;
  color: var(--text-soft);
  font-size: 13px;
  height: 36px;
  padding: 0 6px;
  flex: 0 0 auto;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.cookie-banner .cb-actions .btn-link:hover { color: var(--text); }

/* Categories panel (visible when expanded) */
.cookie-banner .cb-cats {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}
.cookie-banner.expanded .cb-cats { display: flex; }
.cookie-banner.expanded .cb-quick { display: none; }

.cb-cat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color .2s, background .2s;
}
.cb-cat:hover { border-color: var(--border-strong); }
.cb-cat strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 4px;
}
.cb-cat p {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.55;
}

/* Toggle switch */
.cb-switch {
  --w: 36px; --h: 20px;
  position: relative;
  display: inline-block;
  width: var(--w); height: var(--h);
  flex: 0 0 auto;
  margin-top: 2px;
}
.cb-switch input { opacity: 0; width: 0; height: 0; }
.cb-switch .slider {
  position: absolute; inset: 0;
  background: var(--border-strong);
  border-radius: 999px;
  transition: background .25s;
  cursor: pointer;
}
.cb-switch .slider::before {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: calc(var(--h) - 4px); height: calc(var(--h) - 4px);
  background: #fff;
  border-radius: 50%;
  transition: transform .25s var(--tx);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.cb-switch input:checked + .slider {
  background: var(--gradient-brand);
}
.cb-switch input:checked + .slider::before {
  transform: translateX(calc(var(--w) - var(--h)));
}
.cb-switch input:disabled + .slider {
  background: var(--gradient-cool);
  opacity: .65;
  cursor: not-allowed;
}
.cb-cat .always {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  display: block;
}

@media (max-width: 600px) {
  .cookie-banner {
    left: 12px; right: 12px; bottom: 12px;
    width: auto;
    padding: 18px;
  }
  .cookie-banner .cb-actions .btn { min-width: 0; }
}

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(36px) scale(.97);
  transition: opacity .9s var(--tx), transform .9s var(--tx), filter .9s var(--tx);
  filter: blur(6px);
  will-change: opacity, transform, filter;
}
.reveal.in {
  opacity: 1;
  transform: none;
  filter: blur(0);
}
/* Direction variants */
.reveal.from-left  { transform: translateX(-40px) translateY(20px) scale(.97); }
.reveal.from-right { transform: translateX( 40px) translateY(20px) scale(.97); }
.reveal.from-left.in, .reveal.from-right.in { transform: none; }
/* Stagger delays for adjacent items */
.reveal.delay-1 { transition-delay: .08s; }
.reveal.delay-2 { transition-delay: .16s; }
.reveal.delay-3 { transition-delay: .24s; }
.reveal.delay-4 { transition-delay: .32s; }
.reveal.delay-5 { transition-delay: .40s; }
.reveal.delay-6 { transition-delay: .48s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .nav-links { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-visual { display: none; }
  .searchbox { grid-template-columns: 1fr; }
  .steps, .testimonials { grid-template-columns: 1fr; }
  .cta { grid-template-columns: 1fr; padding: 40px; }
  .cta .right { display: none; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .layout-2col { grid-template-columns: 1fr; }
  .filter-card { position: static; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-head { grid-template-columns: 140px 1fr; gap: 16px; }
  .book-card { position: static; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-side { position: static; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .lesson-row { grid-template-columns: 1fr; gap: 8px; }
  .section { padding: 64px 0; }
}
