/*
  GEXA MED — обратная связь по качеству.

  Цвета — с живого сайта med.gexa.ru (style.css темы gexamed): голубой
  #0098D6 на шапке, подвале и главных кнопках, светлый #F1F1F1 фоном
  страницы и текстом на голубом, серые #E2E3E4 и #D1D3D4 для плашек и линий,
  #9B9DA3 и #58595B — второй план, #E6F5FB — мягкая подложка.

  Дизайн-система — общий код gexa.ru (gexa-sites: packages/tokens,
  packages/ui, форма заявки app/components/request): Montserrat из
  @gexa/tokens, прямые углы, заголовки 400 с трекингом −0,04em, метки темы
  10–12 px 700 прописными, поля на подложке с рамкой бренда в фокусе,
  кнопка 56 px, экран успеха с квадратным знаком, кольцо фокуса из
  base.css, ошибки #a4262c.

  Активные состояния — подложкой, без цветных черт слева и снизу.

  Движение — короткое и одно на всю страницу: появление блоков снизу
  (rise), мягкая смена состояний полей, раскрытие ошибок и плиток файлов
  (в app.js). При prefers-reduced-motion всё отключается.
*/

@font-face { font-family: "Montserrat"; src: url("fonts/montserrat-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("fonts/montserrat-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("fonts/montserrat-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("fonts/montserrat-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* med.gexa.ru */
  --med-blue: #0098d6;
  --med-blue-strong: #036e9c;   /* наведение на голубое (роль --brand-primary-strong темы gexa-med) */
  --med-blue-soft: #e6f5fb;
  --med-light: #f1f1f1;
  --med-grey: #e2e3e4;
  --med-grey-strong: #d1d3d4;
  --med-muted: #9b9da3;
  --med-graphite: #58595b;
  --ink: #0f0f0f;
  --surface: #fff;              /* карточки и окна */
  --on-blue: #f1f1f1;           /* текст и кнопка на голубом — в обеих темах */
  --link: #036e9c;              /* текстовые ссылки на светлом */
  --bar: var(--med-blue);       /* шапка и подвал */
  --bar-line: rgba(241, 241, 241, .4);
  --bar-button: var(--on-blue);
  --bar-button-text: var(--med-blue);
  --bar-button-hover: #fff;
  --bar-button-hover-text: var(--med-blue-strong);
  --pop-line: transparent;
  --pop-shadow: rgba(15, 15, 15, .16);
  color-scheme: light;
  /* @gexa/tokens */
  --error: #a4262c;
  --container: min(1320px, calc(100vw - (clamp(20px, 3.2vw, 56px) * 2)));
  --focus: 3px solid color-mix(in srgb, var(--med-blue) 55%, transparent);
  --gap: clamp(24px, 2.6vw, 40px);
  --page-top: clamp(28px, 3.4vw, 56px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --fast: .18s;
  --ring: 0 0 0 3px color-mix(in srgb, var(--med-blue) 16%, transparent);
  --ring-error: 0 0 0 3px color-mix(in srgb, var(--error) 14%, transparent);
}

/* Тёмная тема — только по лампочке в шапке; системная настройка не учитывается.
   Голубой бренда остаётся в кнопках и акцентах; фон, шапка, подвал, карточки,
   линии и текст — тёмные. */
:root[data-theme="dark"] {
  --med-light: #111315;
  --surface: #1c1f22;
  --med-grey: #2b2f33;
  --med-grey-strong: #3d4248;
  --med-muted: #7e8288;
  --med-graphite: #a8abb0;
  --med-blue-soft: #112833;
  --ink: #f1f1f1;
  --link: #0098d6;
  --error: #f2777c;
  --bar: #1c1f22;
  --bar-line: #3d4248;
  --bar-button: #2b2f33;
  --bar-button-text: #f1f1f1;
  --bar-button-hover: #0098d6;
  --bar-button-hover-text: #fff;
  --pop-line: #3d4248;
  --pop-shadow: rgba(0, 0, 0, .55);
  color-scheme: dark;
}
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: background-color .35s ease, color .35s ease, border-color .35s ease, fill-opacity .35s ease, opacity .35s ease !important; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 24px; background: var(--med-light); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--med-light);
  font-family: "Montserrat", Arial, sans-serif;
  font-size: clamp(16px, 1vw, 17px);
  line-height: 1.58;
  letter-spacing: -.02em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; letter-spacing: inherit; color: inherit; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: var(--focus); outline-offset: 3px; }
::selection { color: #fff; background: var(--med-blue); }

.shell { width: var(--container); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes viewer-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.topic { color: var(--med-blue); font-size: 12px; font-weight: 700; line-height: 1.3; letter-spacing: .1em; text-transform: uppercase; }

.skip { position: absolute; left: 16px; top: -100px; z-index: 10; padding: 12px 18px; color: var(--surface); background: var(--ink); font-weight: 600; }
.skip:focus { top: 12px; }

/* ── Шапка: как на med.gexa.ru ─────────────────────────────────── */
.top { color: var(--on-blue); background: var(--bar); }
.top__inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top__logo { min-height: 44px; display: inline-flex; align-items: center; }
.top__logo img { width: 166px; height: auto; }
.top__site {
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--bar-button-text);
  background: var(--bar-button);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  transition: background-color var(--fast), color var(--fast);
}
.top__site svg { width: 14px; height: 14px; flex: none; transition: transform .25s var(--ease); }
.top__site:hover { color: var(--bar-button-hover-text); background: var(--bar-button-hover); }
.top__site:hover svg { transform: translate(2px, -2px); }
.top__site-short { display: none; }
.top__tools { display: flex; align-items: center; gap: 10px; }
.top__theme { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border: 0; color: var(--on-blue); background: transparent; cursor: pointer; transition: background-color var(--fast); }
.top__theme:hover { background: rgba(255, 255, 255, .18); }
.top__theme[aria-pressed="true"] { background: rgba(255, 255, 255, .08); }
.top__theme[aria-pressed="true"]:hover { background: rgba(255, 255, 255, .18); }
.top__theme svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; }
/* Светлая тема — лампочка горит, тёмная — погашена */
.bulb__glass { fill: currentColor; fill-opacity: .34; transition: fill-opacity .3s; }
.bulb__rays { transform-origin: 12px 10px; transition: opacity .3s, transform .35s var(--ease); }
:root[data-theme="dark"] .bulb__glass { fill-opacity: 0; }
:root[data-theme="dark"] .bulb__rays { opacity: 0; transform: scale(.6); }
.top :focus-visible { outline-color: var(--on-blue); }

/* ── Первый экран: заголовок слева, форма справа ─────────────────── */
.page { flex: 1; padding-block: var(--page-top) clamp(48px, 6vw, 96px); }
.layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap); align-items: start; }

.intro { position: sticky; top: 28px; height: calc(100svh - var(--intro-top, 28px) - 28px); container-type: inline-size; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: clamp(28px, 3vw, 44px); }
.intro__copy > * { animation: rise .6s var(--ease) backwards; }
.intro__copy > :nth-child(2) { animation-delay: .06s; }
.intro__copy > :nth-child(3) { animation-delay: .12s; }
.intro h1:focus { outline: 0; }
.intro h1 { max-width: 12ch; margin-top: 20px; font-size: clamp(38px, 3.9vw, 60px); font-weight: 400; line-height: 1.02; letter-spacing: -.045em; text-wrap: balance; }
.intro__lead { max-width: 28ch; margin-top: 20px; color: var(--med-graphite); font-size: clamp(17px, 1.3vw, 20px); line-height: 1.5; text-wrap: balance; }
.intro__photo { width: 100%; height: 100%; min-height: 200px; max-height: 150cqw; align-self: end; overflow: hidden; background: var(--med-grey); animation: rise .7s var(--ease) .18s backwards; }
.intro__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 78% 50%; }

/* ── Форма ─────────────────────────────────────────────────────── */
.form { min-width: 0; background: var(--surface); animation: rise .6s var(--ease) .08s backwards; }
.group { padding: clamp(28px, 3vw, 44px) clamp(24px, 3.4vw, 52px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; }
.group + .group { border-top: 1px solid var(--med-grey); }
.group > * { grid-column: 1 / -1; }
.group__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.group__title { font-size: clamp(21px, 1.7vw, 26px); font-weight: 500; line-height: 1.2; letter-spacing: -.035em; }
.group__count { color: var(--med-graphite); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; transition: color var(--fast); }
.group__count.is-active { color: var(--link); }

.field { min-width: 0; display: grid; gap: 8px; align-content: start; }
.field--short { grid-column: 1 / 2; }
fieldset.field { border: 0; }
.field__label { color: var(--med-graphite); font-size: 12px; font-weight: 600; line-height: 1.4; letter-spacing: .05em; text-transform: uppercase; transition: color var(--fast); }
.field:focus-within > .field__label, .sub:focus-within > .field__label { color: var(--link); }
.field__label i, .field__note i, .check label i, .send__required i { margin-left: 2px; color: var(--med-blue); font-style: normal; }
.field__note i { margin: 0 2px 0 0; }
.field__note { color: var(--med-graphite); font-size: 13px; line-height: 1.45; }
.field__count { justify-self: end; color: var(--med-graphite); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

.control {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 0;
  color: var(--ink);
  background: var(--med-light);
  font-size: 16px;
  line-height: 1.4;
  transition: border-color var(--fast), background-color var(--fast), box-shadow var(--fast);
  -webkit-appearance: none;
  appearance: none;
}
.control--area { min-height: 168px; resize: vertical; line-height: 1.55; }
.control--area.is-auto { resize: none; overflow: hidden; }
.control::placeholder { color: var(--med-muted); opacity: 1; transition: opacity var(--fast); }
.control:focus::placeholder { opacity: .55; }
.control:hover { border-color: var(--med-grey-strong); }
.control:focus { outline: 0; border-color: var(--med-blue); background: var(--surface); box-shadow: var(--ring); }
.control:focus-visible { outline: 0; }
.control[aria-invalid="true"] { border-color: var(--error); background: var(--surface); }
.control[aria-invalid="true"]:focus { box-shadow: var(--ring-error); }
input[type="date"].control { display: block; }
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; }

.field__error { display: flex; align-items: flex-start; gap: 8px; overflow: hidden; color: var(--error); font-size: 13px; font-weight: 600; line-height: 1.45; }
.field__error::before { content: "!"; width: 17px; height: 17px; margin-top: 1px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--surface); background: var(--error); font-size: 11px; font-weight: 700; line-height: 1; }

/* Выпадающий список: подпись с переносом, поверх неё — кнопка и свой
   список по ширине поля (app.js). Без скрипта остаётся родной select. */
.select { position: relative; min-height: 54px; padding: 14px 48px 14px 16px; border: 1px solid transparent; background: var(--med-light); font-size: 16px; line-height: 1.45; transition: border-color var(--fast), background-color var(--fast), box-shadow var(--fast); }
.select:hover { border-color: var(--med-grey-strong); }
.select:focus-within { border-color: var(--med-blue); background: var(--surface); box-shadow: var(--ring); }
.select__value { display: block; overflow-wrap: break-word; }
.select__code { white-space: nowrap; }
.select__chevron { position: absolute; top: 19px; right: 18px; width: 16px; height: 16px; color: var(--med-blue); pointer-events: none; transition: transform .25s var(--ease); }
.select:hover .select__chevron { transform: translateY(2px); }
.select.is-open { z-index: 5; border-color: var(--med-blue); background: var(--surface); box-shadow: var(--ring); }
.select.is-open .select__chevron { transform: rotate(180deg); }
.select__button { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; cursor: pointer; }
.select__button:focus-visible { outline: 0; }
.select__list {
  position: absolute;
  top: calc(100% + 6px);
  left: -1px;
  right: -1px;
  max-height: 320px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--med-grey-strong);
  background: var(--surface);
  box-shadow: 0 18px 40px var(--pop-shadow);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity var(--fast), transform .25s var(--ease), visibility var(--fast);
}
.select.is-open .select__list { visibility: visible; opacity: 1; transform: none; pointer-events: auto; }
.select__option { position: relative; padding: 14px 48px 14px 16px; overflow-wrap: break-word; cursor: pointer; transition: background-color var(--fast); }
.select__option + .select__option { border-top: 1px solid var(--med-grey); }
.select__option.is-active { background: var(--med-light); }
.select__option[aria-selected="true"] { background: var(--med-blue-soft); }
.select__option[aria-selected="true"]::after { content: ""; position: absolute; top: 18px; right: 18px; width: 16px; height: 16px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5' fill='none' stroke='%230098d6' stroke-width='1.8'/%3E%3C/svg%3E") center / contain no-repeat; }
.select__native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; cursor: pointer; font-size: 16px; }
.select__native:focus-visible { outline: 0; }

/* Зона загрузки */
.drop {
  position: relative;
  min-height: 168px;
  padding: 28px 20px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  border: 1px dashed var(--med-grey-strong);
  background: var(--med-light);
  cursor: pointer;
  transition: background-color var(--fast), border-color var(--fast), box-shadow var(--fast);
}
.drop:hover, .drop.is-over { border-color: var(--med-blue); background: var(--med-blue-soft); }
.drop.is-over { border-style: solid; box-shadow: var(--ring); }
.drop:has(.drop__input:focus-visible) { outline: var(--focus); outline-offset: 3px; }
.drop__input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.drop__icon { width: 48px; height: 48px; margin-bottom: 6px; display: grid; place-items: center; color: #fff; background: var(--med-blue); transition: background-color var(--fast), transform .25s var(--ease); }
.drop__icon svg { width: 22px; height: 22px; transition: transform .25s var(--ease); }
.drop:hover .drop__icon svg { transform: translateY(-2px); }
.drop.is-over .drop__icon { transform: translateY(-4px); }
/* Три строки на одном месте: обычная, «отпустите», «предел» */
.drop__lines { display: grid; justify-items: center; }
.drop__lines > * { grid-area: 1 / 1; transition: opacity var(--fast), transform .25s var(--ease), visibility var(--fast); }
.drop__text { font-size: 15px; font-weight: 500; line-height: 1.45; }
.drop__alt { visibility: hidden; opacity: 0; transform: translateY(6px); color: var(--link); font-size: 15px; font-weight: 600; line-height: 1.45; pointer-events: none; }
.drop.is-over .drop__text, .drop.is-full .drop__text { visibility: hidden; opacity: 0; transform: translateY(-6px); }
.drop.is-over:not(.is-full) .drop__alt--over, .drop.is-full .drop__alt--full { visibility: visible; opacity: 1; transform: none; }
.drop.is-full { border-color: var(--med-grey-strong); background: var(--med-light); box-shadow: none; cursor: default; }
.drop.is-full .drop__icon { background: var(--med-muted); transform: none; }
.drop.is-full .drop__icon svg { transform: none; }
.drop.is-full .drop__alt--full { color: var(--ink); }
.drop__pick { color: var(--link); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer; }
.drop__note { color: var(--med-graphite); font-size: 13px; line-height: 1.45; }

/* Плитки файлов */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; list-style: none; }
.tile { position: relative; min-width: 0; display: grid; background: var(--med-light); }
.tile__thumb { width: 100%; aspect-ratio: 4 / 3; padding: 0; display: grid; place-items: center; overflow: hidden; border: 0; border-radius: 0; color: var(--med-blue); background: var(--med-grey); }
button.tile__thumb { cursor: zoom-in; }
.tile__thumb img { width: 100%; height: 100%; object-fit: cover; animation: fade .35s ease; transition: transform .5s var(--ease); }
button.tile__thumb:hover img { transform: scale(1.05); }
.tile__thumb svg { width: 30px; height: 30px; }
.tile__kind { position: absolute; left: 8px; top: 8px; padding: 3px 6px; color: #fff; background: rgba(15, 15, 15, .62); font-size: 10px; font-weight: 700; line-height: 1.2; letter-spacing: .08em; text-transform: uppercase; }
.tile__info { min-width: 0; padding: 10px 12px 12px; display: grid; gap: 2px; }
.tile__name { overflow: hidden; font-size: 13px; font-weight: 500; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.tile__size { color: var(--med-graphite); font-size: 12px; }
.tile__remove { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; color: #0f0f0f; background: rgba(255, 255, 255, .92); cursor: pointer; transition: background-color var(--fast), color var(--fast); }
.tile__remove:hover { color: #fff; background: var(--med-blue); }
.tile__remove svg { width: 14px; height: 14px; }

/* Контакты */
.pair { gap: 10px; }
.pair__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; align-items: start; }
.sub { min-width: 0; display: grid; gap: 8px; align-content: start; }

/* Согласие и отправка */
.send { padding: clamp(28px, 3vw, 40px) clamp(24px, 3.4vw, 52px) clamp(32px, 3.4vw, 52px); display: grid; gap: 24px; background: var(--med-blue-soft); }
.check { display: flex; align-items: flex-start; gap: 12px; }
.check input {
  width: 22px;
  height: 22px;
  margin-top: 0;
  flex: none;
  border: 1px solid var(--med-muted);
  border-radius: 0;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") center / 0 no-repeat;
  cursor: pointer;
  transition: background-color var(--fast), border-color var(--fast), background-size .22s var(--ease), box-shadow var(--fast);
  -webkit-appearance: none;
  appearance: none;
}
.check input:hover { border-color: var(--med-blue); }
.check input:checked { border-color: var(--med-blue); background-color: var(--med-blue); background-size: 14px; }
.check input[aria-invalid="true"] { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.check label { max-width: 62ch; font-size: 14px; line-height: 1.55; cursor: pointer; }
.check label a { color: var(--link); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color var(--fast); }
.check label a:hover { color: var(--ink); }
[data-field="consent"] .field__error { margin-left: 34px; }
.form__status { padding: 14px 16px; overflow: hidden; color: var(--error); background: var(--surface); font-size: 15px; font-weight: 600; }
.send__row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.send__required { color: var(--med-graphite); font-size: 13px; }

/* Кнопки: размеры — форма заявки gexa.ru, цвет — кнопка med.gexa.ru. */
.button {
  min-height: 56px;
  min-width: 240px;
  padding-inline: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: var(--med-blue);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--fast), color var(--fast), box-shadow var(--fast), transform .12s;
}
.button svg { width: 16px; height: 16px; flex: none; transition: transform .25s var(--ease), opacity var(--fast); }
.button:hover { background: var(--med-blue-strong); }
.button:hover > svg, .button:hover .button__arrow { transform: translateX(4px); }
.button:active { transform: translateY(1px); }
/* Стрелка и индикатор отправки на одном месте */
.button__mark { width: 16px; height: 16px; flex: none; display: grid; }
.button__mark svg { grid-area: 1 / 1; }
.button__spinner { opacity: 0; }
.button.is-loading { background: var(--med-blue-strong); cursor: progress; }
.button.is-loading .button__arrow { opacity: 0; transform: translateX(10px); }
.button.is-loading .button__spinner { opacity: 1; animation: spin .8s linear infinite; }
.button--ghost { justify-content: center; color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1px var(--med-grey-strong); }
.button--ghost:hover { color: var(--link); background: var(--med-blue-soft); box-shadow: inset 0 0 0 1px var(--med-blue-soft); }

/* ── Экран «Спасибо» ───────────────────────────────────────────── */
.done { min-height: min(640px, calc(100svh - 200px)); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); background: var(--surface); }
.done__body { padding: clamp(40px, 6vw, 96px) clamp(24px, 5vw, 80px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.done__icon { width: 64px; height: 64px; margin-bottom: clamp(32px, 4vw, 52px); display: grid; place-items: center; color: #fff; background: var(--med-blue); }
.done__icon svg { width: 30px; height: 30px; }
.done__body > * { animation: rise .6s var(--ease) backwards; }
.done__body > :nth-child(2) { animation-delay: .08s; }
.done__body > :nth-child(3) { animation-delay: .14s; }
.done__body > :nth-child(4) { animation-delay: .22s; }
.done__check { stroke-dasharray: 1; animation: draw .45s var(--ease) .3s backwards; }
.done__photo img { animation: fade .8s ease; }
.done h2 { max-width: 14ch; margin-top: 18px; font-size: clamp(36px, 4vw, 62px); font-weight: 400; line-height: 1.02; letter-spacing: -.045em; text-wrap: balance; }
.done h2:focus { outline: 0; }
.done__actions { margin-top: clamp(32px, 4vw, 52px); display: flex; flex-wrap: wrap; gap: 12px; }
.done__photo { overflow: hidden; background: var(--med-grey); }
.done__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 78% 50%; }

/* ── Документы: политика и согласие ─────────────────────────── */
.legal { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: clamp(24px, 3vw, 44px) var(--gap); align-items: start; }
.legal__head { grid-column: 1 / -1; }
.legal__head > * { animation: rise .6s var(--ease) backwards; }
.legal__head h1 { max-width: 22ch; margin-top: 20px; font-size: clamp(32px, 3.4vw, 52px); font-weight: 400; line-height: 1.05; letter-spacing: -.045em; text-wrap: balance; animation-delay: .06s; }
.legal__aside { position: sticky; top: 28px; display: grid; gap: 24px; animation: rise .6s var(--ease) .1s backwards; }
.legal__label { color: var(--med-blue); font-size: 12px; font-weight: 700; line-height: 1.3; letter-spacing: .1em; text-transform: uppercase; }
.legal__back { width: fit-content; min-height: 44px; display: inline-flex; align-items: center; gap: 12px; color: var(--link); font-size: 14px; font-weight: 600; transition: color var(--fast); }
.legal__back svg { width: 16px; height: 16px; flex: none; transition: transform .25s var(--ease); }
.legal__back:hover { color: var(--ink); }
.legal__back:hover svg { transform: translateX(-4px); }
.legal__nav ul, .toc ul { display: grid; gap: 2px; list-style: none; }
.legal__nav a, .toc a { min-height: 44px; padding: 10px 14px; display: flex; align-items: center; color: var(--med-graphite); font-size: 14px; font-weight: 500; line-height: 1.4; transition: background-color var(--fast), color var(--fast); }
.legal__nav a:hover, .toc a:hover { color: var(--ink); background: var(--med-grey); }
.legal__nav a[aria-current="page"] { color: var(--ink); background: var(--surface); font-weight: 600; }
.toc summary { min-height: 44px; padding-inline: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary svg { width: 16px; height: 16px; flex: none; color: var(--med-blue); transition: transform .25s var(--ease); }
.toc[open] summary svg { transform: rotate(180deg); }
.toc a { font-size: 13px; }
/* Адреса в политике написаны без пробелов: anywhere ломает только их. */
.prose { min-width: 0; padding: clamp(28px, 3vw, 48px) clamp(24px, 3.4vw, 56px); overflow-wrap: anywhere; background: var(--surface); font-size: 15px; line-height: 1.7; animation: rise .6s var(--ease) .14s backwards; }
.prose > * { max-width: 820px; }
.prose h2 { margin-top: clamp(32px, 3vw, 44px); scroll-margin-top: 24px; font-size: clamp(19px, 1.5vw, 23px); font-weight: 500; line-height: 1.25; letter-spacing: -.03em; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin-top: 14px; }
.prose > p:first-child { margin-top: 0; }
.prose a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ── Окно про файлы cookie: внизу по центру ──────────────────── */
.cookie { position: fixed; z-index: 20; left: 50%; bottom: clamp(12px, 2vw, 24px); width: min(760px, calc(100vw - 32px)); padding: 18px 18px 18px 24px; display: flex; align-items: center; gap: 16px 28px; transform: translateX(-50%); background: var(--surface); box-shadow: 0 0 0 1px var(--pop-line), 0 18px 48px var(--pop-shadow); animation: fade .45s ease .5s backwards; }
.cookie__text { min-width: 0; flex: 1; font-size: 14px; line-height: 1.5; }
.cookie__text a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color var(--fast); }
.cookie__text a:hover { color: var(--ink); }
.cookie__button { min-width: 0; min-height: 48px; flex: none; justify-content: center; font-size: 15px; }

/* ── Окно просмотра вложения: по центру ──────────────────────── */
.viewer { width: fit-content; min-width: min(360px, calc(100vw - 32px)); max-width: min(1040px, calc(100vw - 32px)); max-height: calc(100svh - 32px); margin: auto; padding: 0; overflow: hidden; border: 0; color: var(--ink); background: var(--surface); }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); animation: viewer-in .26s var(--ease); }
.viewer::backdrop { background: rgba(15, 15, 15, .62); animation: fade .26s ease; }
.viewer__bar { min-height: 52px; padding-left: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.viewer__name { min-width: 0; overflow: hidden; font-size: 14px; font-weight: 600; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.viewer__close { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border: 0; color: var(--ink); background: transparent; cursor: pointer; transition: background-color var(--fast), color var(--fast); }
.viewer__close:hover { color: var(--link); background: var(--med-blue-soft); }
.viewer__close:focus-visible { outline-offset: -3px; }
.viewer__close svg { width: 16px; height: 16px; }
.viewer__stage { min-height: 0; display: grid; place-items: center; background: var(--med-light); }
.viewer__stage img, .viewer__stage video { width: auto; height: auto; max-width: 100%; max-height: calc(100svh - 84px); }

/* ── Подвал: как на med.gexa.ru ──────────────────────────────── */
.foot { color: var(--on-blue); background: var(--bar); }
.foot__top { padding-block: clamp(36px, 4vw, 56px) clamp(24px, 3vw, 36px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; border-bottom: 1px solid var(--bar-line); }
.foot__logo { width: clamp(200px, 17vw, 240px); height: auto; }
.foot__links { display: flex; flex-wrap: wrap; gap: 4px 32px; }
.foot__links a { min-height: 44px; display: inline-flex; align-items: center; font-size: 15px; font-weight: 500; text-decoration: underline transparent; text-underline-offset: 4px; transition: text-decoration-color var(--fast); }
.foot__links a:hover { text-decoration-color: currentColor; }
.foot__copy { padding-block: 20px 28px; font-size: 14px; }
.foot :focus-visible { outline-color: var(--on-blue); }

/* ── Планшет ──────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .intro { position: static; height: auto; container-type: normal; grid-template-rows: none; grid-template-columns: minmax(0, 1fr) minmax(220px, 34%); align-items: end; gap: 28px; }
  .intro h1 { max-width: 16ch; }
  .intro__photo { height: auto; aspect-ratio: 5 / 4; min-height: 0; max-height: none; }
  .done { grid-template-columns: minmax(0, 1fr); }
  .done__photo { display: none; }
  .legal { grid-template-columns: minmax(0, 1fr); }
  .legal__aside { position: static; }
  .legal__nav ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .legal__nav a { background: var(--med-grey); }
}

/* ── Телефон 360–390 px ───────────────────────────────────────── */
@media (max-width: 680px) {
  :root { --container: calc(100vw - 32px); }
  .top__inner { min-height: 60px; }
  .top__logo img { width: 136px; }
  .top__site { padding: 0 12px; font-size: 13px; }
  .top__tools { gap: 6px; }
  .top__site-long { display: none; }
  .top__site-short { display: inline; }
  .page { padding-block: 24px 40px; }
  .intro { grid-template-columns: minmax(0, 1fr); }
  .intro h1 { margin-top: 14px; font-size: clamp(30px, 8.6vw, 36px); }
  .intro__lead { margin-top: 12px; font-size: 16px; }
  .intro__photo { display: none; }
  .form, .done, .prose { margin-inline: -16px; }
  .group { padding: 28px 16px; grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .field--short { grid-column: 1; }
  .group__title { font-size: 20px; }
  .pair__row { grid-template-columns: minmax(0, 1fr); }
  .drop { min-height: 0; padding: 24px 16px; }
  .drop__or { display: none; }
  .files { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .send { padding: 28px 16px 32px; }
  .send__row { flex-direction: column; align-items: stretch; }
  .button { width: 100%; min-width: 0; }
  .done__body { padding: 48px 16px; }
  .done__actions { width: 100%; }
  .legal__head h1 { margin-top: 14px; font-size: clamp(26px, 7.6vw, 34px); }
  .legal__nav ul { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .prose { padding: 28px 16px; }
  .cookie { padding: 16px; flex-direction: column; align-items: stretch; }
  .cookie__text { font-size: 13px; }
  .foot__links { flex-direction: column; gap: 0; }
}

@media (hover: none) and (min-width: 681px) { .drop__or { display: none; } }

/* Низкое окно на компьютере: фото не помещается рядом с формой */
@media (min-width: 1081px) and (max-height: 640px) { .intro__photo { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::backdrop { transition: none !important; animation: none !important; }
}
