/* =========================================================================
   Учительская · Арина Галицкая — дизайн-система
   Фирменная палитра взята с летнего баннера набора:
   тёмно-синий фон + коралл-оранжевый акцент + персиково-кремовый.
   ========================================================================= */

:root {
  /* --- Бренд: тёмный режим (по умолчанию) --- */
  --navy-900: #091a30;
  --navy-850: #0b1e36;
  --navy-800: #0f2742;
  --navy-700: #143052;
  --navy-650: #173a61;
  --navy-600: #1d456f;
  --navy-line: #294e77;

  /* Акцент — глубокий винный/бордо (имена токенов исторические, оставлены для совместимости) */
  --orange:      #8a2136;
  --orange-600:  #6f1728;
  --orange-400:  #a53147;
  --orange-300:  #c05a6c;
  --peach:       #fbe0cd;
  --cream:       #fdf1e7;

  --white: #ffffff;
  --ink:   #142539;

  /* премиум-акценты (дефолты для тёмной темы; light-тема переопределяет ниже) */
  --graphite: #11253f;
  --gold:     #d8a24a;

  /* Семантические токены (тёмная тема) */
  --bg:           var(--navy-850);
  --bg-2:         var(--navy-900);
  --surface:      #102a48;
  --surface-1:    #0e2540;   /* непрозрачные плитки/модалки внутри карточек */
  --surface-2:    #143052;
  --surface-3:    #173a61;
  --panel-border: rgba(255, 255, 255, .08);
  --hairline:     rgba(255, 255, 255, .10);

  --text:         #f3f7fc;
  --text-soft:    #c6d6e8;
  --text-muted:   #8ba4c0;
  --text-faint:   #6f88a6;

  --accent:       var(--orange);
  --accent-text:  #ffffff;
  --accent-soft:  rgba(138, 33, 54, .14);
  --accent-ring:  rgba(138, 33, 54, .38);

  --good:  #36b37e;
  --good-soft: rgba(54, 179, 126, .16);
  --bad:   #e5484d;
  --bad-soft: rgba(229, 72, 77, .16);
  --warn:  #f5a524;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .25);
  --shadow:    0 18px 50px -22px rgba(0, 0, 0, .65);
  --shadow-lg: 0 40px 90px -40px rgba(0, 0, 0, .75);
  --shadow-accent: 0 18px 40px -18px rgba(138, 33, 54, .55);

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;

  --font-display: "Playfair Display", "Times New Roman", Georgia, serif;
  --font-ui: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --container: 1180px;
  --header-h: 72px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* --- Светлая премиум-тема (по умолчанию для визитки) --- */
[data-theme="light"] {
  --bg:           #f6f1ea;   /* тёплый фарфор */
  --bg-2:         #fbf7f1;
  --surface:      #ffffff;
  --surface-1:    #fbf7f1;   /* непрозрачные плитки/модалки внутри карточек */
  --surface-2:    #f3ece2;
  --surface-3:    #ece2d4;
  --panel-border: rgba(33, 28, 23, .10);
  --hairline:     rgba(33, 28, 23, .08);

  --text:         #211b16;   /* тёплый графитовый «ink» */
  --text-soft:    #4c443b;
  --text-muted:   #837a6e;
  --text-faint:   #aaa091;

  --accent-soft:  rgba(138, 33, 54, .12);
  --accent-ring:  rgba(138, 33, 54, .30);

  --graphite:     #2a2a31;   /* графит из её костюма */
  --gold:         #c2933f;   /* приглушённое золото — премиум-акцент */

  --shadow-sm: 0 2px 10px rgba(33, 28, 23, .06);
  --shadow:    0 24px 60px -30px rgba(33, 28, 23, .26);
  --shadow-lg: 0 50px 110px -50px rgba(33, 28, 23, .32);
  --shadow-accent: 0 22px 46px -20px rgba(138, 33, 54, .42);
}

/* ============================ Reset / base ============================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video, iframe { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3, h4 { margin: 0; line-height: 1.12; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }

::selection { background: var(--accent); color: #fff; }

/* Фоновое сияние (аврора) — мягкие пятна бренда */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora .blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; }
.aurora .b1 { width: 540px; height: 540px; top: -160px; right: -120px; background: radial-gradient(circle, var(--orange) 0%, transparent 70%); opacity: .26; }
.aurora .b2 { width: 460px; height: 460px; bottom: -180px; left: -120px; background: radial-gradient(circle, #2b6fb0 0%, transparent 70%); opacity: .30; }
.aurora .b3 { width: 320px; height: 320px; top: 40%; left: 55%; background: radial-gradient(circle, var(--orange-300) 0%, transparent 70%); opacity: .12; }
[data-theme="light"] .aurora .b1 { opacity: .14; }
[data-theme="light"] .aurora .b2 { background: radial-gradient(circle, #c05a6c 0%, transparent 70%); opacity: .12; }
[data-theme="light"] .aurora .b3 { opacity: .10; }

/* ============================ Layout ============================ */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 22px; }
.section { padding-block: clamp(56px, 8vw, 110px); position: relative; }
[id] { scroll-margin-top: calc(var(--header-h) + 12px); } /* якоря не прячутся под sticky-шапкой */
.section-head { max-width: 680px; margin-bottom: 44px; }
.section-head.center { margin-inline: auto; text-align: center; }

.grid { display: grid; gap: 22px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 940px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

/* ============================ Typography helpers ============================ */
.display { font-family: var(--font-display); font-weight: 700; line-height: 1.04; letter-spacing: -.015em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-ui); font-weight: 700; font-size: 12.5px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--accent); border-radius: 2px; }
.eyebrow.no-line::before { display: none; }
.lead { color: var(--text-soft); font-size: clamp(16px, 2.4vw, 19px); }
.accent { color: var(--accent); }
.muted { color: var(--text-muted); }
.serif { font-family: var(--font-display); }

/* Рукописное оранжевое подчёркивание под заголовком (как на баннере) */
.ink-underline { position: relative; display: inline-block; }
.ink-underline::after {
  content: ""; position: absolute; left: 2%; right: 2%; bottom: -.16em; height: .34em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='16' viewBox='0 0 240 16'%3E%3Cpath d='M3 11C46 4 120 3 168 6c28 1.8 50 3.5 69 7' fill='none' stroke='%238a2136' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}

/* ============================ Buttons ============================ */
.btn {
  --bg-btn: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-ui); font-weight: 700; font-size: 15px; letter-spacing: .01em;
  padding: 13px 22px; border-radius: var(--r-pill); border: 1px solid transparent;
  background: var(--bg-btn); color: var(--text);
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .2s, border-color .2s, color .2s;
  white-space: nowrap; user-select: none;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; }

.btn-primary { background: linear-gradient(180deg, var(--orange-400), var(--orange)); color: #fff; box-shadow: var(--shadow-accent); position: relative; overflow: hidden; }
.btn-primary:hover { box-shadow: 0 22px 48px -16px rgba(138, 33, 54, .7); }
/* Премиальный блик, пробегающий по кнопке на hover */
.btn-primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -70%; width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: skewX(-20deg); transition: left .65s var(--ease); pointer-events: none;
}
.btn-primary:hover::after { left: 125%; }
@media (prefers-reduced-motion: reduce) { .btn-primary::after { display: none; } }

.btn-outline { background: transparent; border-color: var(--panel-border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

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

.btn-light { background: var(--white); color: var(--ink); }
.btn-sm { padding: 9px 16px; font-size: 13.5px; }
.btn-lg { padding: 16px 30px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ============================ Cards & panels ============================ */
.card {
  background: var(--surface);
  border: 1px solid var(--panel-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.panel { background: var(--surface); border: 1px solid var(--panel-border); border-radius: var(--r); }
.glass { background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(14px); }

.hover-lift { transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.hover-lift:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--accent-ring); }

/* ============================ Chips / badges ============================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-ui); font-weight: 700; font-size: 11.5px; letter-spacing: .04em;
  text-transform: uppercase; padding: 6px 11px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-ring);
}
.badge.neutral { background: var(--surface-2); color: var(--text-muted); border-color: var(--panel-border); }
.badge.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--panel-border);
}

/* ============================ Forms ============================ */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-family: var(--font-ui); font-weight: 600; font-size: 13.5px; color: var(--text-soft); }
.input, .textarea, select.input {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--panel-border); border-radius: var(--r-sm);
  padding: 13px 15px; transition: border-color .2s, box-shadow .2s, background .2s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .textarea:focus, select.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.checkrow { display: flex; align-items: flex-start; gap: 11px; font-size: 13.5px; color: var(--text-soft); line-height: 1.5; }
.checkrow input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }

/* ============================ Avatar ============================ */
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-family: var(--font-ui); font-weight: 700; font-size: 15px;
  color: #fff; background: linear-gradient(135deg, var(--orange-400), var(--orange-600));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
}
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }

/* ============================ Progress ============================ */
.bar { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--orange-400), var(--orange)); transition: width .6s var(--ease); }

.ring { --p: 0; --sz: 84px; width: var(--sz); height: var(--sz); border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0);
  display: grid; place-items: center; flex: none; }
.ring::before { content: ""; position: absolute; width: calc(var(--sz) - 16px); height: calc(var(--sz) - 16px); border-radius: 50%; background: var(--surface); }
.ring { position: relative; }
.ring > span { position: relative; font-family: var(--font-ui); font-weight: 800; font-size: 18px; }

/* ============================ Utilities ============================ */
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.stack { display: flex; flex-direction: column; }
.gap-6 { gap: 6px; } .gap-10 { gap: 10px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-40 { margin-top: 40px; }
.hide { display: none !important; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--hairline); border: 0; margin: 0; }

/* Scroll-reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* Toast */
.toast-wrap { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  background: var(--navy-700); color: #fff; border: 1px solid var(--panel-border);
  padding: 13px 18px; border-radius: var(--r-pill); box-shadow: var(--shadow-lg);
  font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 10px;
  animation: toastIn .3s var(--ease); max-width: 90vw;
}
.toast .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.toast.good .dot { background: var(--good); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } }

/* Cookie banner */
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 110; margin-inline: auto;
  max-width: 720px; background: var(--surface); border: 1px solid var(--panel-border);
  border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 16px 18px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  animation: toastIn .4s var(--ease);
}
.cookie p { font-size: 13.5px; color: var(--text-soft); flex: 1 1 320px; }
.cookie a { color: var(--accent); text-decoration: underline; }

/* ================= PWA: баннер «Установить приложение» ================= */
.pwa-banner { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 130%); display: flex; align-items: center; gap: 12px; width: min(94vw, 480px); padding: 12px 14px; background: var(--surface-1, #fff); border: 1px solid var(--panel-border, #e5decf); border-radius: 18px; box-shadow: 0 18px 48px rgba(20, 16, 12, .25); z-index: 400; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.pwa-banner.show { transform: translate(-50%, 0); }
.pwa-ico { border-radius: 12px; flex: none; }
.pwa-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pwa-txt b { font-size: 14.5px; }
.pwa-txt small { color: var(--text-soft, #6d6459); font-size: 12.5px; line-height: 1.4; }
.pwa-install { flex: none; font: 600 13.5px var(--font-ui, sans-serif); color: #fff; background: var(--accent, #8a2136); border: 0; border-radius: 11px; padding: 10px 16px; cursor: pointer; }
.pwa-install:hover { filter: brightness(1.08); }
.pwa-close { flex: none; width: 30px; height: 30px; border: 0; background: none; color: var(--text-faint, #9a8f80); font-size: 15px; cursor: pointer; border-radius: 8px; }
.pwa-close:hover { color: var(--text, #26221c); }
