/* =========================================================================
   Trust Legal — стили лендинга (mobile-first)
   Палитра и размеры — по дизайн-системе Trust Legal (02_DESIGN_SYSTEM.md)
   ========================================================================= */

:root {
  /* Бренд-комплект */
  --brand-orange: #d47732;
  --brand-graphite: #454545;
  --light: #f3f3f1;
  --light-2: #e7e7e5;

  /* Веб-адаптация */
  --ink: #242424;
  --deep-ink: #191919;
  --ivory: #f4f1eb;
  --soft-white: #fcfaf7;
  --orange-ink: #984713;          /* акцентный текст на светлом */
  --muted: #6c6862;               /* второстепенный текст на светлом */
  --muted-on-dark: #d7d1c8;       /* второстепенный текст на тёмном */
  --divider: #d9d3ca;

  /* Производные */
  --page: #f6f6f4;                /* фон страницы = фон исходного PNG логотипа */
  --orange-hover: #e08a4a;
  --orange-active: #c4692a;
  --field-border: #8a847b;        /* ≥3:1 к белому */
  --placeholder: #7a746c;
  --danger: #b3261e;
  --focus-light: #191919;
  --focus-dark: #f3f3f1;

  --font-serif: 'Cormorant Garamond', 'DejaVu Serif', Georgia, serif;
  --font-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --container: 1280px;
  --gutter: 20px;
  --section-y: 64px;
  --gap: 20px;
  --header-h: 72px;
  --radius: 6px;
  --radius-sm: 4px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 180ms;
  --t-reveal: 520ms;
}

@media (min-width: 768px) {
  :root { --gutter: 40px; --section-y: 96px; --gap: 28px; }
}
@media (min-width: 1200px) {
  :root { --gutter: 72px; --section-y: 120px; --gap: 36px; --header-h: 88px; }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
@media (min-width: 768px) { body { font-size: 17px; } }

img { display: block; max-width: 100%; height: auto; }
/* Cormorant по умолчанию рисует старостильные цифры («01» → «oı») — включаем обычные */
body, .hero__title, .section-title { font-variant-numeric: lining-nums; }
.nowrap { white-space: nowrap; }
h1, h2, h3, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

:focus-visible { outline: 2px solid var(--focus-light); outline-offset: 3px; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--deep-ink);
  color: var(--light);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Типографика ---------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange-ink);
}
.eyebrow::before {
  content: '';
  flex: none;
  width: 32px;
  height: 1px;
  background: var(--brand-orange);
}
.eyebrow--light { color: var(--muted-on-dark); }

.section { padding: var(--section-y) 0; }

.section-title {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(32px, 4.2vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.005em;
  max-width: 20ch;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.section-lead {
  margin-top: 20px;
  max-width: 60ch;
  color: var(--muted);
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease,
              border-color var(--t-fast) ease, transform var(--t-fast) ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn--sm { min-height: 44px; padding: 10px 18px; font-size: 14px; }
.btn--lg { min-height: 56px; padding: 14px 28px; }
.btn--block { width: 100%; }

.btn--primary { background: var(--brand-orange); color: var(--deep-ink); }
.btn--primary:hover { background: var(--orange-hover); }
.btn--primary:active { background: var(--orange-active); }

.btn--ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--ghost:hover { background: var(--ink); color: var(--light); }

.btn[disabled] { cursor: progress; }
.btn__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn.is-loading { opacity: 0.85; }
.btn.is-loading .btn__spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Шапка ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--page);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.header.is-scrolled {
  border-bottom-color: var(--divider);
  box-shadow: 0 6px 20px -18px rgba(25, 25, 25, 0.5);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
}

.header__logo { display: inline-flex; flex: none; border-radius: var(--radius-sm); }
.header__logo img { width: auto; height: 44px; }
@media (min-width: 1200px) { .header__logo img { height: 52px; } }

.header__cta { margin-left: auto; }
.only-narrow { display: inline; }
.only-wide { display: none; }
@media (min-width: 560px) {
  .only-narrow { display: none; }
  .only-wide { display: inline; }
}

/* ---------- Hero ---------- */

.hero { padding: 24px 0 calc(48px + env(safe-area-inset-bottom)); }

.hero__grid { display: grid; gap: 36px; }

.hero__title {
  margin-top: 18px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(38px, 11vw, 48px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.hero__lead {
  margin-top: 22px;
  max-width: 44ch;
  font-size: 18px;
  color: var(--muted);
}

.hero__value {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  font-weight: 600;
}
.hero__value::before {
  content: '';
  flex: none;
  width: 3px;
  height: 22px;
  background: var(--brand-orange);
}

/* На телефоне первый экран уплотнён, чтобы форма начиналась сразу */
@media (max-width: 559px) {
  .hero { padding-top: 12px; }
  .hero__grid { gap: 14px; }
  .hero__title { margin-top: 12px; font-size: clamp(34px, 9.6vw, 42px); }
  .hero__lead { margin-top: 12px; font-size: 17px; }
  .hero__value { margin-top: 14px; }
  .hero /* ---------- Форма ---------- */

.form-card { padding: 20px 16px 18px; }
  .hero .form-card__head { margin-bottom: 14px; }
  .hero .form-card__title { font-size: 26px; }
  .hero .form-card__sub { margin-top: 4px; font-size: 14px; }
  .hero .form { gap: 12px; }
  .hero .field__input { min-height: 50px; }
}

/* Планшет: форма рядом с текстом, без фото */
@media (min-width: 720px) and (max-width: 899px) {
  .hero__grid { grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
  .hero__title { font-size: clamp(40px, 5.8vw, 50px); }
  .hero .form-card { padding: 28px 24px 24px; }
}

/* Форма на первом экране: на телефоне — сразу под текстом,
   на компьютере — поверх фото с аркой */
.hero__form { position: relative; }
.hero__media { display: none; }
.hero .form-card { border: 1px solid var(--divider); box-shadow: 0 24px 48px -32px rgba(25, 25, 25, 0.45); }

@media (min-width: 560px) {
  .hero__title { font-size: clamp(46px, 7.4vw, 64px); }
}

@media (min-width: 900px) {
  .hero { padding: 32px 0 64px; }
  .hero__grid {
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 5vw, 72px);
    align-items: center;
  }
  .hero__title { font-size: clamp(52px, 4.9vw, 76px); }
  .hero__form { padding: 48px 0; }
  .hero__media {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 72%;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--light-2);
  }
  .hero__media picture, .hero__media img { width: 100%; height: 100%; }
  .hero__media img { object-fit: cover; object-position: 70% 50%; }
  .hero .form-card { position: relative; width: min(470px, 88%); border: 0; box-shadow: 0 30px 60px -28px rgba(25, 25, 25, 0.55); }
}

.form-card {
  padding: 28px 20px 24px;
  border-radius: var(--radius);
  background: var(--soft-white);
  color: var(--ink);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
  scroll-margin-top: calc(var(--header-h) + 12px);
}
@media (min-width: 560px) { .form-card { padding: 40px 36px 32px; } }

.form-card__head { margin-bottom: 24px; }
.form-card__title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.1;
}
.form-card__sub { margin-top: 8px; font-size: 15px; color: var(--muted); }

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

.field { display: grid; gap: 6px; }
.field__label { font-size: 14px; font-weight: 600; }
.field__input {
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;             /* ≥16px: iOS не масштабирует страницу при фокусе */
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
  -webkit-appearance: none;
  appearance: none;
}
.field__input::placeholder { color: var(--placeholder); }
.field__input:hover { border-color: var(--ink); }
.field__input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(212, 119, 50, 0.5); }
.field__input:disabled { background: var(--light); cursor: not-allowed; }
.field.is-invalid .field__input { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.field.is-invalid .field__input:focus { box-shadow: inset 0 0 0 1px var(--danger), 0 0 0 3px rgba(179, 38, 30, 0.25); }

.field__error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--danger);
}
.field__error::before {
  content: '!';
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}
.field__error:empty { display: none; }

.select { position: relative; }
.select::after {
  content: '';
  position: absolute;
  right: 18px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select__control { padding-right: 44px; cursor: pointer; text-overflow: ellipsis; }
.select__control:invalid { color: var(--placeholder); }
.select__control option { color: var(--ink); }

.form__submit { margin-top: 6px; }
.form__status { font-size: 15px; font-weight: 600; color: var(--danger); }
.form__status:empty { display: none; }
.form__consent { font-size: 13px; line-height: 1.5; color: var(--muted); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-success { display: grid; justify-items: start; gap: 12px; outline: none; }
.form-success[hidden] { display: none; }
.form-success__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--brand-orange);
  color: var(--deep-ink);
}
.form-success__icon svg { width: 26px; height: 26px; }
.form-success__title { font-family: var(--font-serif); font-size: 28px; font-weight: 600; line-height: 1.15; }
.form-success__text { color: var(--muted); }

/* intl-tel-input под наши поля */
.field .iti { display: block; width: 100%; }
.iti {
  --iti-border-color: var(--divider);
  --iti-hover-color: rgba(212, 119, 50, 0.12);
  --iti-icon-color: var(--muted);
  --iti-spacer-horizontal: 14px;
}
.iti__selected-country { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.iti__selected-dial-code { color: var(--ink); font-weight: 600; font-size: 16px; }
.iti__dropdown-content { border: 1px solid var(--divider); border-radius: var(--radius-sm); color: var(--ink); font-family: var(--font-sans); }
.iti__search-input { font-family: var(--font-sans); font-size: 16px; padding: 12px 14px; }
.iti__country { padding: 10px 14px; font-size: 15px; }
.iti--fullscreen-popup .iti__country { padding: 14px 16px; }
.iti__country.iti__highlight { background-color: rgba(212, 119, 50, 0.14); }
.iti__dial-code { color: var(--muted); }

/* ---------- Баннер согласия на cookie ---------- */

.consent {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 50;
  display: grid;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  background: var(--soft-white);
  box-shadow: 0 20px 50px -20px rgba(25, 25, 25, 0.45);
  font-size: 14px;
  line-height: 1.5;
}
.consent[hidden] { display: none; }
.consent__actions { display: flex; gap: 10px; }
.consent__actions .btn { flex: 1; }

/* ---------- Появление при прокрутке ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--t-reveal) var(--ease), transform var(--t-reveal) var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Страница «Дякуємо» ---------- */

.thanks { padding: var(--section-y) 0; }
.thanks__inner { display: grid; justify-items: start; gap: 20px; max-width: 640px; }
.thanks__title { font-family: var(--font-serif); font-size: clamp(44px, 6vw, 76px); font-weight: 600; line-height: 1.05; }
.thanks__text { color: var(--muted); font-size: 18px; }
