/* ============================================================
   Lingua — изучение испанского
   Общий стиль для всех экранов. Mobile-first, 360–1280px.
   Цвета — через CSS-переменные. Тёмная тема: [data-theme="dark"].
   ============================================================ */

/* ---------- 1. Токены ---------- */
:root {
  /* Бренд */
  --c-primary:        #E8590C;   /* терракота / закатный оранж */
  --c-primary-600:    #CC4E08;
  --c-primary-700:    #A93F06;
  --c-primary-soft:   #FCEBDD;   /* мягкая подложка акцента */

  --c-secondary:      #1B8090;   /* спокойный бирюзовый */
  --c-secondary-600:  #14707F;
  --c-secondary-soft: #E2F1F2;

  /* Состояния */
  --c-success:        #2E9E4F;
  --c-success-soft:   #E4F4E8;
  --c-danger:         #E03131;
  --c-danger-soft:    #FCE6E6;

  /* Нейтральные (тёплые) */
  --bg:               #FAF7F3;
  --surface:          #FFFFFF;
  --surface-2:        #F3EDE5;
  --surface-3:        #ECE3D8;
  --text:             #2A2620;
  --text-muted:       #7C7264;
  --text-faint:       #A89E8F;
  --border:           #ECE3D7;
  --border-strong:    #DDD1C1;

  /* Радиусы */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* Тени (мягкие, тёплые) */
  --sh-sm: 0 1px 2px rgba(60, 44, 24, .06), 0 1px 3px rgba(60, 44, 24, .05);
  --sh-md: 0 4px 14px rgba(60, 44, 24, .07), 0 2px 4px rgba(60, 44, 24, .05);
  --sh-lg: 0 18px 40px rgba(60, 44, 24, .10), 0 6px 14px rgba(60, 44, 24, .06);
  --sh-accent: 0 10px 26px rgba(232, 89, 12, .30);

  /* Типографика */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --font-display: var(--font);

  /* Сетка */
  --maxw: 1120px;
  --gap: 24px;
  --header-h: 68px;
}

[data-theme="dark"] {
  --c-primary-soft:   rgba(232, 89, 12, .16);
  --c-secondary-soft: rgba(27, 128, 144, .18);
  --c-success-soft:   rgba(46, 158, 79, .18);
  --c-danger-soft:    rgba(224, 49, 49, .18);

  --bg:               #161310;
  --surface:          #211C16;
  --surface-2:        #2A241C;
  --surface-3:        #342D23;
  --text:             #F2ECE2;
  --text-muted:       #A99E8E;
  --text-faint:       #7E7464;
  --border:           #352E25;
  --border-strong:    #443B2F;

  --sh-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --sh-md: 0 4px 14px rgba(0, 0, 0, .40);
  --sh-lg: 0 18px 40px rgba(0, 0, 0, .50);
  --sh-accent: 0 10px 26px rgba(232, 89, 12, .35);
}

/* ---------- 2. База ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .25s ease, color .25s ease;
}

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--c-primary) 55%, transparent); outline-offset: 2px; border-radius: 4px; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

.muted { color: var(--text-muted); }
.es { color: var(--c-primary); font-weight: 700; font-style: normal; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- 3. Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 16px; font-weight: 700; line-height: 1;
  padding: 14px 22px; border-radius: var(--r-pill);
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease, color .2s ease;
  text-align: center; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 20px; height: 20px; flex: none; }

.btn--primary { background: var(--c-primary); color: #fff; box-shadow: var(--sh-accent); }
.btn--primary:hover { background: var(--c-primary-600); }

.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--sh-sm); }
.btn--secondary:hover { border-color: var(--c-primary); color: var(--c-primary); }

.btn--ghost { background: transparent; color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); }

.btn--block { display: flex; width: 100%; }
.btn--lg { padding: 18px 30px; font-size: 18px; }
.btn--sm { padding: 10px 16px; font-size: 14px; }

.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ---------- 4. Карточки ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
}
.card--pad { padding: 24px; }

/* ---------- 5. Бейджи / чипы ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; line-height: 1;
  padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text-muted);
}
.badge svg { width: 14px; height: 14px; }
.badge--accent  { background: var(--c-primary-soft);   color: var(--c-primary-700); }
.badge--teal    { background: var(--c-secondary-soft); color: var(--c-secondary-600); }
.badge--success { background: var(--c-success-soft);   color: var(--c-success); }
.badge--lock    { background: var(--surface-3);        color: var(--text-faint); }
[data-theme="dark"] .badge--accent { color: #F4A06A; }

/* ---------- 6. Прогресс ---------- */
.progress { background: var(--surface-3); border-radius: var(--r-pill); height: 10px; overflow: hidden; }
.progress__bar {
  height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--c-primary), #F4843E);
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}
.progress--thin { height: 6px; }

/* ---------- 7. Шапка приложения ---------- */
.appbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.appbar__inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 20px;
  max-width: var(--maxw); margin-inline: auto; padding-inline: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 20px; letter-spacing: -.03em; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--c-primary), #F4843E);
  box-shadow: var(--sh-accent);
}
.brand__mark svg { width: 20px; height: 20px; }

.appnav { display: none; align-items: center; gap: 4px; margin-left: 8px; }
.appnav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 15px; color: var(--text-muted);
  transition: background .2s, color .2s;
}
.appnav a svg { width: 18px; height: 18px; }
.appnav a:hover { background: var(--surface-2); color: var(--text); }
.appnav a.is-active { background: var(--c-primary-soft); color: var(--c-primary-700); }
[data-theme="dark"] .appnav a.is-active { color: #F4A06A; }

.appbar__spacer { flex: 1; }
.appbar__actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 42px; height: 42px; border-radius: var(--r-pill);
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  transition: background .2s, color .2s, border-color .2s;
}
.icon-btn:hover { color: var(--c-primary); border-color: var(--c-primary); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .icon-btn__sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-btn__sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-btn__moon { display: none; }

.avatar {
  width: 42px; height: 42px; border-radius: var(--r-pill); flex: none;
  display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(140deg, var(--c-secondary), #3FB0BF);
}

/* Нижняя таб-навигация (моб.) */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  display: flex; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 0 9px; font-size: 11px; font-weight: 600; color: var(--text-muted);
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.is-active { color: var(--c-primary); }

/* ---------- 8. Сетки ---------- */
.page { padding-block: 28px 96px; }
.grid { display: grid; gap: var(--gap); }

/* ---------- 9. Лендинг ---------- */
.landing-top {
  display: flex; align-items: center; gap: 16px;
  max-width: var(--maxw); margin-inline: auto; padding: 20px;
}
.hero { position: relative; overflow: hidden; }
.hero__inner { display: grid; gap: 36px; padding-block: 40px 56px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px; color: var(--c-primary-700);
  background: var(--c-primary-soft); padding: 8px 14px; border-radius: var(--r-pill);
  width: max-content;
}
[data-theme="dark"] .eyebrow { color: #F4A06A; }
.hero h1 { font-size: clamp(34px, 8vw, 60px); letter-spacing: -.035em; }
.hero__lead { font-size: clamp(17px, 2.4vw, 21px); color: var(--text-muted); max-width: 30ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__stats { display: flex; gap: 28px; margin-top: 8px; flex-wrap: wrap; }
.hero__stat b { display: block; font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.hero__stat span { font-size: 14px; color: var(--text-muted); }

.hero__art {
  position: relative; min-height: 280px;
  display: grid; place-items: center;
}
.hero-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--sh-lg); padding: 26px;
  width: min(360px, 100%);
}
.hero-card__word { font-size: 40px; font-weight: 900; letter-spacing: -.03em; }
.hero-card__ipa { color: var(--text-muted); font-size: 15px; margin-bottom: 16px; }
.hero-card__tr { font-size: 18px; }
.hero-chip {
  position: absolute; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-pill); box-shadow: var(--sh-md); padding: 10px 16px;
  font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 8px;
}
.hero-chip svg { width: 16px; height: 16px; }
.hero-chip--1 { top: 6%; right: 4%; color: var(--c-success); }
.hero-chip--2 { bottom: 8%; left: 0; color: var(--c-secondary-600); }

.features { display: grid; gap: 18px; padding-block: 8px 40px; }
.feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 28px 24px; box-shadow: var(--sh-sm);
}
.feature__ic {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  margin-bottom: 16px; color: #fff;
}
.feature__ic svg { width: 26px; height: 26px; }
.feature:nth-child(1) .feature__ic { background: linear-gradient(140deg, var(--c-primary), #F4843E); }
.feature:nth-child(2) .feature__ic { background: linear-gradient(140deg, var(--c-secondary), #3FB0BF); }
.feature:nth-child(3) .feature__ic { background: linear-gradient(140deg, #2E9E4F, #61C281); }
.feature h3 { font-size: 21px; }
.feature p { color: var(--text-muted); margin: 0; }

.section-head { text-align: center; max-width: 36ch; margin: 0 auto 28px; }
.section-head h2 { font-size: clamp(26px, 5vw, 38px); }
.section-head p { color: var(--text-muted); }

.landing-foot {
  border-top: 1px solid var(--border); padding: 28px 20px; text-align: center;
  color: var(--text-muted); font-size: 14px;
}

/* ---------- 10. Авторизация ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(440px, 100%); padding: 32px; }
.auth-card .brand { justify-content: center; margin-bottom: 22px; }
.auth-tabs {
  display: flex; gap: 4px; background: var(--surface-2);
  border-radius: var(--r-pill); padding: 5px; margin-bottom: 24px;
}
.auth-tabs button {
  flex: 1; padding: 11px; border: 0; background: transparent; cursor: pointer;
  border-radius: var(--r-pill); font-weight: 700; font-size: 15px; color: var(--text-muted);
  transition: background .2s, color .2s, box-shadow .2s;
}
.auth-tabs button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--sh-sm); }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 7px; }
.input {
  width: 100%; padding: 14px 16px; font-size: 16px; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md); transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: var(--text-faint); }
.input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-soft); }
.input-group { position: relative; }
.input-group .input { padding-left: 46px; }
.input-group__ic {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); pointer-events: none;
}
.input-group__ic svg { width: 20px; height: 20px; }
.auth-meta { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin: 6px 0 20px; }
.auth-meta a { color: var(--c-primary); font-weight: 600; }
.auth-alt { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 14px; }
.auth-alt a { color: var(--c-primary); font-weight: 700; }
.auth-form[hidden] { display: none; }

/* ---------- 11. Дашборд ---------- */
.dash-hello { margin-bottom: 24px; }
.dash-hello h1 { font-size: clamp(26px, 5vw, 36px); }
.dash-hello p { color: var(--text-muted); margin: 0; }

.dash-grid { display: grid; gap: var(--gap); }

.review-widget {
  background: linear-gradient(135deg, var(--c-primary), #F4843E);
  color: #fff; border-radius: var(--r-xl); padding: 28px;
  box-shadow: var(--sh-accent); position: relative; overflow: hidden;
}
.review-widget::after {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.review-widget__label { font-weight: 700; opacity: .9; display: inline-flex; align-items: center; gap: 8px; }
.review-widget__num { font-size: 64px; font-weight: 900; line-height: 1; letter-spacing: -.04em; margin: 8px 0 2px; }
.review-widget__sub { opacity: .9; margin-bottom: 22px; }
.review-widget .btn {
  background: #fff; color: var(--c-primary-700); box-shadow: 0 8px 20px rgba(0,0,0,.18);
  position: relative; z-index: 1;
}
.review-widget .btn:hover { background: #fff; color: var(--c-primary); }

.level-card .level-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.level-card__lvl { font-size: 22px; font-weight: 900; }
.level-card__pct { font-weight: 800; color: var(--c-primary); }
.level-card__meta { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 14px; margin-top: 10px; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 16px; }
.section-title h2 { font-size: 21px; margin: 0; }
.section-title a { color: var(--c-primary); font-weight: 700; font-size: 14px; }

.continue-list { display: grid; gap: 12px; }
.lesson-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--sh-sm);
  transition: transform .12s, box-shadow .2s, border-color .2s;
}
.lesson-row:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--border-strong); }
.lesson-row__ic {
  width: 48px; height: 48px; border-radius: 14px; flex: none; display: grid; place-items: center;
  background: var(--c-primary-soft); color: var(--c-primary-700);
}
[data-theme="dark"] .lesson-row__ic { color: #F4A06A; }
.lesson-row__ic svg { width: 24px; height: 24px; }
.lesson-row__body { flex: 1; min-width: 0; }
.lesson-row__title { font-weight: 700; }
.lesson-row__meta { font-size: 13px; color: var(--text-muted); }
.lesson-row__progress { width: 100%; margin-top: 8px; }
.lesson-row__cta { color: var(--text-faint); flex: none; }

.stat-card { text-align: center; padding: 20px; }
.stat-card b { font-size: 30px; font-weight: 900; display: block; letter-spacing: -.02em; }
.stat-card span { color: var(--text-muted); font-size: 13px; }
.streak b { color: var(--c-primary); }

/* ---------- 12. Карта курса ---------- */
.course-head { margin-bottom: 22px; }
.course-head h1 { font-size: clamp(26px, 5vw, 36px); }
.level-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px;
  margin-bottom: 28px; scrollbar-width: none;
}
.level-tabs::-webkit-scrollbar { display: none; }
.level-tab {
  flex: none; border: 1.5px solid var(--border-strong); background: var(--surface);
  border-radius: var(--r-pill); padding: 11px 20px; cursor: pointer;
  font-weight: 800; font-size: 15px; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 9px;
  transition: all .2s;
}
.level-tab small { font-weight: 600; font-size: 12px; opacity: .8; }
.level-tab:hover { border-color: var(--c-primary); color: var(--text); }
.level-tab.is-active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; box-shadow: var(--sh-accent); }
.level-tab.is-active small { color: rgba(255,255,255,.85); }

.level-pane[hidden] { display: none; }
.unit { margin-bottom: 28px; }
.unit__head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.unit__num {
  width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center;
  font-weight: 900; background: var(--c-secondary-soft); color: var(--c-secondary-600);
}
.unit__title { font-size: 19px; font-weight: 800; margin: 0; }
.unit__sub { font-size: 13px; color: var(--text-muted); }
.unit__bar { flex: 1; max-width: 160px; margin-left: auto; }

.unit-lessons {
  display: grid; gap: 10px; padding-left: 0; list-style: none; margin: 0;
}
.course-lesson {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 15px 18px; box-shadow: var(--sh-sm);
  transition: transform .12s, box-shadow .2s, border-color .2s;
}
.course-lesson:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.course-lesson--locked { opacity: .62; }
.course-lesson--locked:hover { transform: none; box-shadow: var(--sh-sm); }
.course-lesson__check {
  width: 34px; height: 34px; border-radius: var(--r-pill); flex: none; display: grid; place-items: center;
  border: 2px solid var(--border-strong); color: var(--text-faint);
}
.course-lesson__check svg { width: 18px; height: 18px; }
.course-lesson--done .course-lesson__check { background: var(--c-success); border-color: var(--c-success); color: #fff; }
.course-lesson--current .course-lesson__check { border-color: var(--c-primary); color: var(--c-primary); border-style: solid; }
.course-lesson__body { flex: 1; min-width: 0; }
.course-lesson__title { font-weight: 700; }
.course-lesson__meta { font-size: 13px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.course-lesson__meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-lesson__meta svg { width: 14px; height: 14px; }

/* ---------- 13. Урок ---------- */
.lesson-layout { display: grid; gap: var(--gap); }
.lesson-header { margin-bottom: 6px; }
.lesson-header .badge { margin-bottom: 12px; }
.lesson-header h1 { font-size: clamp(28px, 5vw, 40px); }
.lesson-header p { color: var(--text-muted); margin: 0; }
.lesson-steps { display: flex; gap: 6px; margin-top: 18px; }
.lesson-steps span { flex: 1; height: 5px; border-radius: var(--r-pill); background: var(--surface-3); }
.lesson-steps span.is-on { background: var(--c-primary); }

.lesson-theory {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: clamp(22px, 4vw, 38px); box-shadow: var(--sh-md);
}
.lesson-theory h2 { font-size: 26px; margin-top: 0; }
.lesson-theory h3 { font-size: 19px; margin-top: 28px; color: var(--c-primary-700); }
[data-theme="dark"] .lesson-theory h3 { color: #F4A06A; }
.lesson-theory p { font-size: 17.5px; line-height: 1.7; }
.lesson-theory ul { font-size: 17px; line-height: 1.7; padding-left: 22px; }
.lesson-theory .callout {
  border-left: 4px solid var(--c-secondary); background: var(--c-secondary-soft);
  padding: 16px 18px; border-radius: 0 var(--r-md) var(--r-md) 0; margin: 22px 0;
  font-size: 16px;
}
.example {
  background: var(--surface-2); border-radius: var(--r-md); padding: 14px 18px; margin: 12px 0;
  font-size: 18px;
}
.example .es { font-size: 19px; }
.example__tr { color: var(--text-muted); font-size: 15px; margin-top: 2px; }

.conj-table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 18px 0; font-size: 16.5px; }
.conj-table caption { text-align: left; font-weight: 800; margin-bottom: 10px; font-size: 17px; }
.conj-table th, .conj-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.conj-table thead th { background: var(--surface-2); color: var(--text-muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.conj-table tbody th { font-weight: 600; color: var(--text-muted); }
.conj-table td .es { font-weight: 700; }
.conj-table tr:last-child th, .conj-table tr:last-child td { border-bottom: 0; }
.conj-table { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }

/* Упражнения */
.exercises { display: grid; gap: 18px; }
.exercises__head { display: flex; align-items: center; gap: 12px; margin-bottom: 2px; }
.exercises__head h2 { font-size: 24px; margin: 0; }

.exercise {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: clamp(20px, 3.5vw, 30px); box-shadow: var(--sh-md);
}
.exercise__num {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700;
  color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .05em;
}
.exercise__q { font-size: 20px; font-weight: 700; margin-bottom: 18px; line-height: 1.4; }
.exercise__q .blank {
  display: inline-block; min-width: 90px; border-bottom: 2.5px dashed var(--c-primary);
  text-align: center; color: var(--c-primary); font-weight: 800;
}

.options { display: grid; gap: 12px; }
.option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 16px 18px; border-radius: var(--r-md); cursor: pointer;
  background: var(--surface); border: 2px solid var(--border-strong);
  font-size: 17px; font-weight: 600; color: var(--text);
  transition: border-color .15s, background .15s, transform .1s;
}
.option:hover:not(:disabled) { border-color: var(--c-primary); }
.option:active:not(:disabled) { transform: scale(.99); }
.option__key {
  width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--surface-2); font-weight: 800; font-size: 14px; color: var(--text-muted);
}
.option__mark { margin-left: auto; flex: none; opacity: 0; }
.option__mark svg { width: 22px; height: 22px; }
.option.is-correct { border-color: var(--c-success); background: var(--c-success-soft); color: var(--c-success); }
.option.is-correct .option__key { background: var(--c-success); color: #fff; }
.option.is-correct .option__mark { opacity: 1; color: var(--c-success); }
.option.is-wrong { border-color: var(--c-danger); background: var(--c-danger-soft); color: var(--c-danger); }
.option.is-wrong .option__key { background: var(--c-danger); color: #fff; }
.option.is-wrong .option__mark { opacity: 1; color: var(--c-danger); }
.option:disabled { cursor: default; }

.ex-input {
  width: 100%; padding: 15px 18px; font-size: 18px; color: var(--text);
  background: var(--surface); border: 2px solid var(--border-strong); border-radius: var(--r-md);
  transition: border-color .2s, box-shadow .2s;
}
.ex-input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-soft); }
.ex-input.is-correct { border-color: var(--c-success); background: var(--c-success-soft); }
.ex-input.is-wrong { border-color: var(--c-danger); background: var(--c-danger-soft); }

/* match */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.match__col { display: grid; gap: 10px; align-content: start; }
.match__item {
  padding: 15px 16px; border-radius: var(--r-md); cursor: pointer; text-align: center;
  background: var(--surface); border: 2px solid var(--border-strong); font-size: 17px; font-weight: 700;
  transition: all .15s;
}
.match__item:hover:not(:disabled) { border-color: var(--c-primary); }
.match__item.is-sel { border-color: var(--c-primary); background: var(--c-primary-soft); color: var(--c-primary-700); }
.match__item.is-done { border-color: var(--c-success); background: var(--c-success-soft); color: var(--c-success); cursor: default; }
.match__item.is-wrong { border-color: var(--c-danger); background: var(--c-danger-soft); color: var(--c-danger); animation: shake .35s; }
.match__col--es .match__item { color: var(--c-primary); }
.match__col--es .match__item.is-done { color: var(--c-success); }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }

/* фидбэк-блок */
.feedback { margin-top: 16px; border-radius: var(--r-md); padding: 0 18px; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .3s, opacity .3s, padding .3s; }
.feedback.is-show { max-height: 260px; opacity: 1; padding: 16px 18px; }
.feedback__title { font-weight: 800; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.feedback__title svg { width: 20px; height: 20px; }
.feedback--ok { background: var(--c-success-soft); color: var(--c-success); }
.feedback--no { background: var(--c-danger-soft); color: var(--c-danger); }
.feedback p { margin: 0; color: var(--text); font-size: 15px; }
.feedback--ok p, .feedback--no p { color: var(--text); }
.ex-check { margin-top: 18px; }

.lesson-finish { display: flex; justify-content: center; padding-top: 8px; }

/* Результат урока (overlay) */
.result-overlay {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(6px); padding: 24px; place-items: center;
}
.result-overlay.is-open { display: grid; }
.result-card {
  width: min(440px, 100%); text-align: center; padding: 40px 32px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--sh-lg); animation: pop .35s cubic-bezier(.2,.8,.3,1.2);
}
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result-ring { width: 150px; height: 150px; margin: 0 auto 18px; position: relative; }
.result-ring svg { transform: rotate(-90deg); }
.result-ring__num { position: absolute; inset: 0; display: grid; place-content: center; }
.result-ring__num b { font-size: 38px; font-weight: 900; }
.result-ring__num span { font-size: 13px; color: var(--text-muted); }
.result-card h2 { font-size: 28px; margin-bottom: 6px; }
.result-card p { color: var(--text-muted); }
.result-stats { display: flex; gap: 12px; margin: 22px 0; }
.result-stat { flex: 1; background: var(--surface-2); border-radius: var(--r-md); padding: 14px; }
.result-stat b { display: block; font-size: 22px; font-weight: 900; }
.result-stat span { font-size: 12px; color: var(--text-muted); }
.result-actions { display: grid; gap: 10px; }

/* ---------- 14. Флешкарты (review) ---------- */
.review-screen {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg);
}
.review-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; max-width: 720px; margin-inline: auto; width: 100%;
}
.review-bar__close { flex: none; }
.review-bar__progress { flex: 1; }
.review-bar__count { font-weight: 800; font-size: 14px; color: var(--text-muted); white-space: nowrap; }
.review-bar__count b { color: var(--c-primary); }

.review-stage {
  flex: 1; display: grid; place-items: center; padding: 16px 20px 24px;
  max-width: 720px; margin-inline: auto; width: 100%;
}
.flashcard {
  width: 100%; max-width: 520px; aspect-ratio: 3 / 4; max-height: 60vh;
  perspective: 1600px; cursor: pointer; user-select: none;
}
.flashcard__inner {
  position: relative; width: 100%; height: 100%;
  transition: transform .55s cubic-bezier(.4,.1,.2,1); transform-style: preserve-3d;
}
.flashcard.is-flipped .flashcard__inner { transform: rotateY(180deg); }
.flashcard__face {
  position: absolute; inset: 0; backface-visibility: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--sh-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 30px;
}
.flashcard__face--back { transform: rotateY(180deg); }
.flashcard__tag { position: absolute; top: 18px; left: 18px; }
.flashcard__hint { position: absolute; bottom: 18px; left: 0; right: 0; color: var(--text-faint); font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.flashcard__hint svg { width: 15px; height: 15px; }
.flashcard__word { font-size: clamp(34px, 9vw, 52px); font-weight: 900; letter-spacing: -.03em; }
.flashcard__ipa { color: var(--text-muted); font-size: 17px; margin-top: 6px; }
.flashcard__tr { font-size: clamp(28px, 7vw, 40px); font-weight: 800; color: var(--c-primary); }
.flashcard__ex { margin-top: 18px; font-size: 17px; max-width: 28ch; }
.flashcard__ex .es { font-weight: 700; }
.flashcard__ex-tr { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.review-rate {
  max-width: 720px; margin-inline: auto; width: 100%;
  padding: 16px 20px calc(24px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.review-rate[hidden] { display: none; }
.rate-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 6px; border-radius: var(--r-md); cursor: pointer;
  border: 2px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 800; font-size: 15px; transition: transform .1s, border-color .2s, background .2s;
}
.rate-btn:hover { transform: translateY(-2px); }
.rate-btn small { font-weight: 600; font-size: 12px; color: var(--text-muted); }
.rate-btn--again:hover  { border-color: var(--c-danger);  background: var(--c-danger-soft); }
.rate-btn--hard:hover   { border-color: #E8902C; background: rgba(232,144,44,.12); }
.rate-btn--good:hover   { border-color: var(--c-secondary); background: var(--c-secondary-soft); }
.rate-btn--easy:hover   { border-color: var(--c-success); background: var(--c-success-soft); }

.review-flip-hint { max-width: 720px; margin: 0 auto; width: 100%; padding: 0 20px 20px; text-align: center; }

.review-done {
  flex: 1; display: none; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 24px; gap: 4px;
}
.review-done.is-open { display: flex; }
.review-done__badge {
  width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c-success-soft); color: var(--c-success); margin-bottom: 18px;
  animation: pop .4s cubic-bezier(.2,.8,.3,1.2);
}
.review-done__badge svg { width: 56px; height: 56px; }
.review-done h2 { font-size: 32px; }
.review-done p { color: var(--text-muted); max-width: 34ch; }
.review-done__stats { display: flex; gap: 24px; margin: 22px 0 26px; }
.review-done__stat b { display: block; font-size: 28px; font-weight: 900; }
.review-done__stat span { font-size: 13px; color: var(--text-muted); }

/* ---------- 15. Адаптив ---------- */
@media (min-width: 560px) {
  .features { grid-template-columns: repeat(3, 1fr); }
  .result-stats { gap: 14px; }
}
@media (min-width: 720px) {
  .hero__inner { grid-template-columns: 1.1fr .9fr; align-items: center; padding-block: 64px 80px; }
  .dash-grid { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .dash-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 860px) {
  .appnav { display: flex; }
  .tabbar { display: none; }
  .page { padding-bottom: 56px; }
  .lesson-layout { max-width: 760px; margin-inline: auto; }
}
@media (min-width: 1000px) {
  .dash-grid { grid-template-columns: 1.5fr 1fr; }
}

/* ============================================================
   16. Лендинг v2 — насыщенный герой, мини-визуализации, плашки
   ============================================================ */

/* Тёплое свечение за героем */
.hero {
  background:
    radial-gradient(120% 90% at 88% -10%, var(--c-primary-soft), transparent 55%),
    radial-gradient(80% 60% at 0% 100%, var(--c-secondary-soft), transparent 60%);
}
.eyebrow { white-space: nowrap; }

/* --- Превью приложения в герое --- */
.hero__art { min-height: 420px; }
.app-preview {
  position: relative; z-index: 2; width: min(380px, 100%);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--sh-lg);
  padding: 18px; transform: rotate(-1.6deg);
}
.app-preview__bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 0 2px; }
.app-preview__dots { display: flex; gap: 6px; }
.app-preview__dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); }
.app-preview__title { font-size: 12px; font-weight: 800; color: var(--text-faint); letter-spacing: .02em; }
.app-preview__pill { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--c-primary); background: var(--c-primary-soft); padding: 4px 9px; border-radius: var(--r-pill); }

.preview-flash {
  background: var(--surface-2); border-radius: var(--r-lg); padding: 24px 18px;
  text-align: center; border: 1px solid var(--border);
}
.preview-flash__tag { font-size: 11px; font-weight: 800; color: var(--c-secondary-600); text-transform: uppercase; letter-spacing: .06em; }
.preview-flash__w { font-size: 36px; font-weight: 900; letter-spacing: -.03em; margin: 6px 0 2px; }
.preview-flash__ipa { font-size: 14px; color: var(--text-muted); }
.preview-flash__tr { margin-top: 12px; font-size: 18px; font-weight: 800; color: var(--c-primary); }

.preview-rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; }
.preview-rate b {
  text-align: center; font-size: 12px; font-weight: 800; padding: 9px 4px; border-radius: var(--r-sm);
  border: 1.5px solid var(--border-strong); color: var(--text-muted);
}
.preview-rate b:nth-child(1) { color: var(--c-danger); border-color: color-mix(in srgb, var(--c-danger) 35%, var(--border-strong)); }
.preview-rate b:nth-child(3) { color: var(--c-secondary-600); }
.preview-rate b:nth-child(4) { color: var(--c-success); border-color: color-mix(in srgb, var(--c-success) 35%, var(--border-strong)); }

/* Декоративная мягкая форма позади превью */
.hero__blob {
  position: absolute; z-index: 1; width: 280px; height: 280px; border-radius: 42% 58% 60% 40%;
  background: linear-gradient(140deg, var(--c-primary), #F4843E);
  opacity: .14; right: 8%; top: 12%; filter: blur(2px);
}

/* Плавающие чипы (переопределяем позиции для нового арта) */
.hero-chip { z-index: 3; }
.hero-chip--1 { top: 3%; right: 7%; }
.hero-chip--2 { bottom: 2%; left: 4%; }
.hero-chip--3 { top: 42%; right: 4%; color: var(--c-primary); }

/* --- Лента «для кого / цифры» --- */
.trust-strip {
  display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; justify-content: center;
  padding: 18px 20px; margin: 8px auto 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  color: var(--text-muted); font-size: 14px; font-weight: 600;
}
.trust-strip span { display: inline-flex; align-items: center; gap: 8px; }
.trust-strip svg { width: 18px; height: 18px; color: var(--c-primary); }
.trust-strip .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }

/* --- Фичи с мини-визуализациями --- */
.features { padding-block: 48px 16px; }
.feature { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.feature__viz {
  height: 150px; padding: 18px; display: flex; flex-direction: column; justify-content: center; gap: 8px;
  border-bottom: 1px solid var(--border); position: relative;
}
.feature:nth-child(1) .feature__viz { background: var(--c-primary-soft); }
.feature:nth-child(2) .feature__viz { background: var(--c-secondary-soft); }
.feature:nth-child(3) .feature__viz { background: var(--c-success-soft); }
.feature__body { padding: 22px 24px 26px; }
.feature__body h3 { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.feature__chip {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff;
}
.feature__chip svg { width: 19px; height: 19px; }
.feature:nth-child(1) .feature__chip { background: var(--c-primary); }
.feature:nth-child(2) .feature__chip { background: var(--c-secondary); }
.feature:nth-child(3) .feature__chip { background: var(--c-success); }

/* мини: строки спряжения */
.viz-rows { display: grid; gap: 7px; }
.viz-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: var(--r-sm); padding: 8px 11px; box-shadow: var(--sh-sm); }
.viz-row span { font-size: 13px; color: var(--text-muted); }
.viz-row b { margin-left: auto; font-size: 14px; color: var(--c-primary); }
/* мини: флешкарта */
.viz-card { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--sh-sm); padding: 16px; text-align: center; }
.viz-card__w { font-size: 24px; font-weight: 900; letter-spacing: -.02em; }
.viz-card__tr { font-size: 14px; color: var(--c-secondary-600); font-weight: 700; margin-top: 2px; }
/* мини: график прогресса */
.viz-bars { display: flex; align-items: flex-end; gap: 8px; height: 80px; }
.viz-bars i { flex: 1; border-radius: 5px 5px 0 0; background: var(--c-success); opacity: .85; }
.viz-streak { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--c-success); }
.viz-streak svg { width: 16px; height: 16px; }

/* --- Плашка «как это работает» --- */
.band {
  background: linear-gradient(135deg, var(--c-primary), #F4843E); color: #fff;
  border-radius: var(--r-xl); padding: clamp(32px, 5vw, 52px); margin: 48px 0;
  position: relative; overflow: hidden;
}
.band::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.10); }
.band__head { text-align: center; max-width: 30ch; margin: 0 auto 32px; position: relative; z-index: 1; }
.band__head h2 { font-size: clamp(26px, 4.5vw, 36px); }
.band__head p { opacity: .92; margin: 0; }
.steps { display: grid; gap: 22px; position: relative; z-index: 1; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step__n { width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; font-size: 20px; font-weight: 900; background: rgba(255,255,255,.18); }
.step h3 { font-size: 19px; margin: 4px 0 4px; }
.step p { margin: 0; opacity: .9; font-size: 15px; }

/* --- Галерея фото-плейсхолдеров --- */
.gallery { display: grid; gap: 16px; margin-bottom: 8px; }
.ph {
  position: relative; border-radius: var(--r-lg); overflow: hidden; min-height: 200px;
  border: 1.5px dashed var(--border-strong);
  background: repeating-linear-gradient(45deg, var(--surface-2) 0 12px, var(--surface-3) 12px 24px);
  display: grid; place-items: center; text-align: center; padding: 16px;
}
.ph__label {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 600;
  color: var(--text-muted); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 7px 13px; display: inline-flex; align-items: center; gap: 7px;
}
.ph__label svg { width: 15px; height: 15px; color: var(--text-faint); }
.ph--tall { min-height: 100%; }

/* --- Финальный CTA --- */
.cta-final { text-align: center; padding: 56px 24px 24px; }
.cta-final h2 { font-size: clamp(28px, 5vw, 42px); }
.cta-final p { color: var(--text-muted); max-width: 40ch; margin: 0 auto 24px; }
.cta-final .hero__cta { justify-content: center; }

@media (min-width: 560px) {
  .gallery { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
  .gallery .ph:nth-child(1) { grid-row: span 2; }
}
@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .step { flex-direction: column; }
}

/* меньше движения */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
