/* ============================================================
   МВ-Сервис — Design System «Premium Estate» (light + emerald)
   Базовые токены, типографика, общие компоненты
   ============================================================ */

:root {
  /* — Палитра — */
  --emerald-900: #06251b;
  --emerald-800: #0a3527;
  --emerald-700: #0d4a34;
  --emerald-600: #0f5c41;
  --emerald-500: #128a5f;   /* основной акцент */
  --emerald-400: #1aa574;
  --emerald-300: #57c79b;
  --emerald-100: #d7efe3;
  --emerald-50:  #eef7f1;

  --brass: #b6913f;         /* тонкий тёплый вторичный акцент */
  --brass-soft: #e9dcbf;

  --ink: #10201a;           /* основной текст */
  --ink-2: #35443d;         /* вторичный текст */
  --muted: #6a7a72;         /* приглушённый */
  --faint: #93a29a;

  --paper: #f7f8f5;         /* фон страницы (тёплый белый) */
  --paper-2: #eef1ea;       /* секции */
  --card: #ffffff;
  --line: #e4e8e1;          /* границы */
  --line-2: #d3dace;

  --ok: #17925f;
  --warn: #c98a1a;
  --danger: #c0392b;
  --info: #2b7bb9;

  /* — Типографика — */
  --font-display: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* — Радиусы / тени — */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 34px;
  --r-full: 999px;

  --sh-sm: 0 1px 2px rgba(16,32,26,.06), 0 2px 6px rgba(16,32,26,.04);
  --sh-md: 0 4px 14px rgba(16,32,26,.07), 0 12px 30px rgba(16,32,26,.06);
  --sh-lg: 0 10px 30px rgba(16,32,26,.09), 0 30px 70px rgba(16,32,26,.10);
  --sh-emerald: 0 10px 30px rgba(18,138,95,.28);

  --wrap: 1240px;
  --gap: clamp(18px, 3vw, 34px);
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  letter-spacing: -.005em;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select, button { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.08; letter-spacing: -.015em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }

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

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* — Бренд / логотип (общий для лендинга и кабинетов) — */
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  background: linear-gradient(150deg, var(--emerald-600), var(--emerald-800));
  display: grid; place-items: center; color: #fff; box-shadow: var(--sh-emerald);
  position: relative; overflow: hidden;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { display: block; font-family: var(--font-display); font-weight: 600; font-size: 21px; letter-spacing: -.02em; color: var(--ink); line-height: 1.05; }
.brand-sub { display: block; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-top: 3px; }

/* — Типографические классы — */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.05;
  text-wrap: balance;
  font-feature-settings: "kern" 1;
}
.display em, em.display-em { font-style: italic; font-weight: 600; }
/* заголовки уровня hero — экстражирные для акцента */
h1.display, .svc-hero h1 { font-weight: 800; letter-spacing: -.03em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--emerald-600); font-feature-settings: "kern" 1;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1.5px; background: var(--brass); display: inline-block;
}
.lead { font-size: clamp(17px, 2vw, 20px); color: var(--ink-2); line-height: 1.6; letter-spacing: -.01em; text-wrap: pretty; }

/* лининг-цифры для крупных числовых показателей */
.stat .num, .kpi .val, .hero-trust .num, .about-points .num, .pf-metrics .mv,
.rcpt-table .total, .tl-year .y { font-variant-numeric: lining-nums tabular-nums; }

/* — Кнопки — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: var(--r-full);
  font-weight: 700; font-size: 15px; letter-spacing: .01em;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s, color .2s, border-color .2s;
  white-space: nowrap; border: 1.5px solid transparent;
}
.btn svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
.btn-primary, .btn-dark { position: relative; overflow: hidden; }
.btn-primary::after, .btn-dark::after {
  content: ""; position: absolute; top: 0; left: -120%; width: 45%; height: 100%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-18deg);
}
.btn-primary:hover::after, .btn-dark:hover::after { animation: btnShine .9s var(--ease); }
.btn-primary:hover svg, .btn-dark:hover svg, .btn-light:hover svg, .btn-ghost:hover svg { transform: translateX(3px); }
.btn-primary { background: var(--emerald-600); color: #fff; box-shadow: var(--sh-emerald); }
.btn-primary:hover { background: var(--emerald-700); transform: translateY(-2px); box-shadow: 0 16px 40px rgba(18,138,95,.34); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--emerald-500); color: var(--emerald-700); background: var(--emerald-50); }
.btn-light { background: #fff; color: var(--ink); box-shadow: var(--sh-sm); }
.btn-light:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 13.5px; }
.btn-lg { padding: 17px 34px; font-size: 16px; }

/* — Чипы / бэйджи — */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: var(--r-full);
  font-size: 13px; font-weight: 600; background: var(--emerald-50); color: var(--emerald-700);
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: var(--r-full); font-size: 12.5px; font-weight: 700;
  letter-spacing: .01em;
}
.badge-dot::before { content:""; width:7px; height:7px; border-radius:50%; background: currentColor; }
.badge-ok    { background: #e6f4ec; color: #0f7a4d; }
.badge-warn  { background: #fbf1dc; color: #a9741a; }
.badge-danger{ background: #fbe7e4; color: #b23120; }
.badge-info  { background: #e6f0f8; color: #22648f; }
.badge-muted { background: var(--paper-2); color: var(--muted); }

/* — Поля форм (общие: лендинг + кабинеты) — */
.field { margin-bottom: 16px; position: relative; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; letter-spacing: .01em; }
.field input, .field textarea, .field select {
  width: 100%; padding: 14px 16px; border-radius: var(--r-md); border: 1.5px solid var(--line-2);
  background: var(--paper); color: var(--ink); font-size: 15px; font-weight: 500;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s; outline: none; -webkit-appearance: none;
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); font-weight: 400; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--line-2); background: var(--card); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--emerald-500); box-shadow: 0 0 0 4px var(--emerald-50); background: var(--card); }
.field textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
/* кастомная стрелка селекта */
.field select { appearance: none; -moz-appearance: none; padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a7a72' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; }
/* поле с иконкой слева */
.field-icon .fi-ic { position: absolute; left: 15px; top: 40px; color: var(--faint); pointer-events: none; }
.field-icon .fi-ic svg { width: 19px; height: 19px; }
.field-icon input { padding-left: 46px; }
.field-icon .fi-toggle { position: absolute; right: 12px; top: 36px; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--faint); }
.field-icon .fi-toggle:hover { color: var(--emerald-600); background: var(--emerald-50); }
.field-icon .fi-toggle svg { width: 18px; height: 18px; }
/* состояние ошибки */
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(192,57,43,.08); }
.field .field-err { color: var(--danger); font-size: 12.5px; font-weight: 600; margin-top: 6px; }

/* — Прелоадер — */
.preloader {
  position: fixed; inset: 0; z-index: 9999; background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  transition: opacity .6s var(--ease), visibility .6s;
}
.preloader.hide { opacity: 0; visibility: hidden; }
.pl-mark {
  width: 74px; height: 74px; border-radius: 20px; color: #fff;
  background: linear-gradient(150deg, var(--emerald-600), var(--emerald-800));
  display: grid; place-items: center; box-shadow: var(--sh-emerald); animation: plPulse 1.8s var(--ease) infinite;
}
.pl-mark svg { width: 38px; height: 38px; }
@keyframes plPulse { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-8px) scale(1.05); } }
.pl-bar { width: 148px; height: 3px; border-radius: 99px; background: var(--line); overflow: hidden; position: relative; }
.pl-bar::before { content: ""; position: absolute; top: 0; left: -45%; width: 45%; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--emerald-400), var(--emerald-600)); animation: plBar 1.15s var(--ease) infinite; }
@keyframes plBar { 0% { left: -45%; } 100% { left: 100%; } }
.pl-name { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -.01em; color: var(--ink); }
.pl-name span { color: var(--muted); font-family: var(--font-sans); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; display: block; text-align: center; margin-top: 4px; }

/* — Cookie-баннер — */
.cookie-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 150; padding: 16px;
  transform: translateY(120%); transition: transform .4s var(--ease);
}
.cookie-bar.in { transform: none; }
.cookie-inner {
  max-width: 1080px; margin: 0 auto; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-lg); padding: 18px 22px;
  display: flex; align-items: center; gap: 18px;
}
.cookie-ic { width: 46px; height: 46px; border-radius: 13px; background: var(--emerald-50); color: var(--emerald-600); display: grid; place-items: center; flex: none; }
.cookie-ic svg { width: 24px; height: 24px; }
.cookie-txt { flex: 1; min-width: 0; }
.cookie-txt b { font-size: 15px; }
.cookie-txt p { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.cookie-txt a { color: var(--emerald-700); font-weight: 600; text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; flex: none; }
@media (max-width: 720px) {
  .cookie-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; }
}

/* — Анимации появления — */
.reveal { opacity: 0; transform: translateY(30px); filter: blur(6px);
  transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease); will-change: opacity, transform; }
.reveal.in { opacity: 1; transform: none; filter: none; }
.reveal-left { transform: translateX(-34px); }
.reveal-right { transform: translateX(34px); }
.reveal-scale { transform: scale(.94); filter: blur(4px); }
.reveal-left.in, .reveal-right.in, .reveal-scale.in { transform: none; }
[data-delay="1"]{ transition-delay: .09s } [data-delay="2"]{ transition-delay: .18s }
[data-delay="3"]{ transition-delay: .27s } [data-delay="4"]{ transition-delay: .36s }
[data-delay="5"]{ transition-delay: .45s } [data-delay="6"]{ transition-delay: .54s }

/* маска-reveal для строк заголовка */
.line-mask { display: block; overflow: hidden; }
.line-mask > span { display: block; transform: translateY(105%); transition: transform 1s var(--ease); }
.line-mask.in > span, .in .line-mask > span { transform: none; }

/* плавающее свечение */
@keyframes floatGlow {
  0%,100% { transform: translate(0,0) scale(1); opacity: .5; }
  50% { transform: translate(-30px, 24px) scale(1.08); opacity: .7; }
}
/* мягкое всплытие */
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
/* пульс-точка */
@keyframes pulseDot { 0% { box-shadow: 0 0 0 0 rgba(87,199,155,.5); } 70% { box-shadow: 0 0 0 10px rgba(87,199,155,0); } 100% { box-shadow: 0 0 0 0 rgba(87,199,155,0); } }
/* блик по кнопке */
@keyframes btnShine { 0% { left: -120%; } 60%,100% { left: 130%; } }

/* курсор-подсветка карточек (spotlight) */
.spot::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(18,138,95,.12), transparent 62%);
  opacity: 0; transition: opacity .35s var(--ease); z-index: 0;
}
.spot:hover::before { opacity: 1; }

.grid { display: grid; gap: var(--gap); }
.text-brass { color: var(--brass); }
.text-emerald { color: var(--emerald-600); }

/* — Scrollbar — */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
