/* ==========================================================
   Страница записи на КТ
   Отделение лучевой диагностики №3 · НМИЦ им. В.А. Алмазова

   Токены общие с каруселями. Единственный источник значений —
   макеты/tokens.css; здесь hex не пишем, только var(--…).
   Рядом лежит его копия tokens.css — путь импорта одинаков и
   локально, и на сервере, чтобы выкладка ничего не правила на лету.
   ========================================================== */

@import url("tokens.css");

/* WOFF2 с кириллическим сабсетом: 1224 КБ TTF → 155 КБ.
   Исходные TTF лежат в макеты/fonts — оттуда пересобираются при смене набора знаков. */
@font-face { font-family:"PF"; src:url("fonts/PlayfairDisplay-var.woff2") format("woff2");
             font-weight:400 900; font-style:normal; font-display:swap; }
@font-face { font-family:"PF"; src:url("fonts/PlayfairDisplay-Italic-var.woff2") format("woff2");
             font-weight:400 900; font-style:italic; font-display:swap; }
@font-face { font-family:"Plex"; src:url("fonts/IBMPlexSans-Regular.woff2") format("woff2");
             font-weight:100 700; font-style:normal; font-display:swap; }
@font-face { font-family:"PlexMono"; src:url("fonts/IBMPlexMono-Medium.woff2") format("woff2");
             font-weight:500; font-style:normal; font-display:swap; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--body);
  font-size: 17px; line-height: 1.55;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Видимый фокус обязателен во всём документе — см. БРЕНДБУК, §3. */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-sm);
}

/* ---------- типографика ---------- */

h1, h2, h3 { font-family: var(--head); color: var(--navy); letter-spacing: -.015em; }
h1 { font-size: 34px; line-height: 1.12; font-weight: 700; }
h2 { font-size: 26px; line-height: 1.18; font-weight: 700; }
h3 { font-size: 21px; line-height: 1.25; font-weight: 700; }

.rule { width: 64px; height: 4px; background: var(--crimson); border-radius: 3px; margin-bottom: var(--s-4); }

.kicker {
  font-family: var(--mono); font-weight: 500; font-size: 13px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--crimson);
}
.it { font-family: var(--acc); font-style: italic; font-weight: 500; }
.lead { font-size: 19px; line-height: 1.5; }
.note { font-size: 15px; line-height: 1.45; color: var(--muted); }
.note b, .lead b { color: var(--navy); font-weight: 600; }

section { padding-block: var(--s-7); }
section > .wrap > .kicker { display: block; margin-bottom: var(--s-3); }
.sect-head { margin-bottom: var(--s-6); max-width: 62ch; }
.sect-head p { margin-top: var(--s-3); }

/* ---------- шапка ---------- */

.top {
  background: var(--navy-deep); color: var(--on-dark);
  padding-block: var(--s-3);
  position: sticky; top: 0; z-index: 20;
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
/* min-width:0 обязателен: без него длинное название держит флекс-строку
   шире вьюпорта и вся страница уезжает горизонтально. */
.mark { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.mark .name, .mark > div { min-width: 0; }
.mark .glyph {
  width: 38px; height: 38px; border-radius: 10px; border: 2px solid var(--on-dark);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--head); font-weight: 800; font-size: 17px; color: var(--on-dark);
  flex: none;
}
.mark .name { font-family: var(--head); font-weight: 700; font-size: 17px; line-height: 1.15; }
.mark .name span {
  display: block; font-family: var(--body); font-weight: 400;
  font-size: 13px; color: var(--on-dark-muted);
}
.top .tel {
  flex: none;
  font-family: var(--head); font-weight: 700; font-size: 18px; color: var(--on-dark);
  text-decoration: none; white-space: nowrap;
  font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1;
}
.top .tel small { display: block; font-family: var(--body); font-weight: 400; font-size: 12px; color: var(--on-dark-muted); }

@media (max-width: 479px) {
  .top .mark .name { font-size: 15px; }
  .top .mark .name span { display: none; }
  .top .mark .glyph { width: 34px; height: 34px; font-size: 15px; }
  .top .tel { font-size: 16px; }
}

/* ---------- первый экран ---------- */

.hero { background: var(--paper); padding-block: var(--s-7); border-bottom: 1px solid var(--hair); }
.hero .grid { display: grid; gap: var(--s-6); align-items: center; }
.hero h1 { margin-bottom: var(--s-4); }
.hero h1 .red { color: var(--crimson); }
.hero-sub {
  font-size: 19px; line-height: 1.4; font-weight: 600; color: var(--navy);
  margin-top: calc(var(--s-3) * -1);
}
.hero .quote {
  font-family: var(--acc); font-style: italic; font-weight: 500;
  font-size: 21px; line-height: 1.4; color: var(--navy);
  border-left: 4px solid var(--crimson); padding-left: var(--s-4);
  margin-block: var(--s-5);
}
.hero .who { margin-top: var(--s-4); }
.hero .who b { color: var(--navy); }
.hero .actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }

.portrait { position: relative; }
.portrait img {
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  width: 100%; max-height: 460px; object-fit: cover; object-position: 50% 12%;
}
.portrait figcaption {
  font-family: var(--mono); font-size: 13px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted); margin-top: var(--s-3);
}

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 var(--s-6);
  border: 0; border-radius: var(--r-md); cursor: pointer;
  font-family: var(--body); font-size: 17px; font-weight: 600;
  text-decoration: none; transition: background .15s, color .15s;
}
.btn-primary { background: var(--action); color: var(--paper); }
.btn-primary:hover { background: var(--action-hover); }
.btn-primary:active { background: var(--action-active); }
.btn-primary[disabled] { background: var(--action-disabled); color: var(--muted); cursor: default; }
.btn-ghost {
  background: transparent; color: var(--navy);
  border: 2px solid var(--navy); min-height: 52px;
}
.btn-ghost:hover { background: var(--slab); }

/* ---------- карточки и списки ---------- */

.cards { display: grid; gap: var(--s-4); }
.card {
  background: var(--paper); border-radius: var(--r-lg); padding: var(--s-5);
  box-shadow: var(--shadow-card);
}
.card h3 { margin-bottom: var(--s-2); }

/* Список услуг внутри карточки: маркер — фирменная красная чёрточка. */
.tick { list-style: none; display: grid; gap: var(--s-2); margin-top: var(--s-3); }
.tick li { padding-left: var(--s-5); position: relative; font-size: 16px; line-height: 1.4; }
.tick li::before {
  content: ""; position: absolute; left: 0; top: 10px;
  width: 10px; height: 2px; background: var(--crimson); border-radius: 2px;
}

.steps { display: grid; gap: var(--s-4); counter-reset: step; }
.step {
  display: grid; grid-template-columns: 56px 1fr; gap: var(--s-4); align-items: start;
  background: var(--paper); border-radius: var(--r-lg); padding: var(--s-5);
  box-shadow: var(--shadow-card);
}
.step .n {
  font-family: var(--head); font-weight: 800; font-size: 28px; color: var(--steel);
  font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1;
  text-align: center;
}
.step h3 { margin-bottom: var(--s-1); }

.two { display: grid; gap: var(--s-4); }
.panel {
  background: var(--slab); border-left: 5px solid var(--crimson);
  border-radius: 0 var(--r-md) var(--r-md) 0; padding: var(--s-5);
}
.panel.pink { background: var(--pink); }
.panel .eyebrow {
  font-family: var(--mono); font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: var(--s-3);
}
.panel ul { list-style: none; display: grid; gap: var(--s-3); }
.panel li { padding-left: var(--s-5); position: relative; }
.panel li::before {
  content: ""; position: absolute; left: 0; top: 10px;
  width: 10px; height: 2px; background: var(--crimson); border-radius: 2px;
}

.facts { display: grid; gap: var(--s-3); margin-top: var(--s-5); }
.facts div { display: grid; grid-template-columns: 22px 1fr; gap: var(--s-3); }
.facts span { color: var(--crimson); font-weight: 700; }

/* Повтор призыва на длинной странице: между героем и формой три экрана. */
.cta-strip {
  margin-top: var(--s-6);
  background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  padding: var(--s-5);
  display: grid; gap: var(--s-4); align-items: center;
}
.cta-strip p { font-size: 19px; line-height: 1.4; color: var(--navy); }
.cta-strip .btn { width: 100%; }

/* ---------- форма ---------- */

.booking { background: var(--paper); }
.form-grid { display: grid; gap: var(--s-6); align-items: start; }

form .field { margin-bottom: var(--s-4); }
form label { display: block; font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: var(--s-2); }
form label .req { color: var(--crimson); }

.input, select.input, textarea.input {
  width: 100%; min-height: 52px; padding: 0 var(--s-4);
  font-family: var(--body); font-size: 17px; color: var(--ink);
  background: var(--field-bg);
  border: 1.5px solid var(--field-border); border-radius: var(--r-sm);
  transition: border-color .15s;
}
textarea.input { min-height: 104px; padding-block: var(--s-3); line-height: 1.5; resize: vertical; }
.input:hover { border-color: var(--field-border-hover); }
.input:focus { border-color: var(--field-border-focus); outline: none; box-shadow: var(--focus-ring); }
.input[aria-invalid="true"] { border-color: var(--error); background: var(--error-bg); }
.input::placeholder { color: var(--muted); }

.err { display: none; margin-top: var(--s-2); font-size: 15px; color: var(--error); font-weight: 600; }
.field.is-error .err { display: block; }

.hint { margin-top: var(--s-2); font-size: 15px; color: var(--muted); }

.consent { display: grid; grid-template-columns: 24px 1fr; gap: var(--s-3); align-items: start; margin-bottom: var(--s-5); }
.consent input { width: 24px; height: 24px; margin-top: 2px; accent-color: var(--crimson); flex: none; }
.consent label { font-size: 15px; font-weight: 400; color: var(--ink); line-height: 1.45; margin: 0; }
.consent a { color: var(--navy); }

/* honeypot — скрыт от человека, виден боту */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin-top: var(--s-4); font-size: 16px; font-weight: 600; }
.form-status.ok   { color: var(--success); }
.form-status.fail { color: var(--error); }

.aside-call {
  background: var(--navy-deep); color: var(--on-dark);
  border-radius: var(--r-lg); padding: var(--s-6);
}
.aside-call .tel-big {
  display: inline-block; margin-block: var(--s-3);
  font-family: var(--head); font-weight: 800; font-size: 30px; color: var(--on-dark);
  text-decoration: none;
  font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1;
}
.aside-call dl { display: grid; gap: var(--s-3); margin-top: var(--s-4); }
.aside-call dt {
  font-family: var(--mono); font-size: 12px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--on-dark-muted);
}
.aside-call dd { color: var(--on-dark-soft); }
.aside-call dd b { color: var(--on-dark); font-weight: 600; }

/* ---------- дисклеймер ---------- */

.disclaimer {
  background: var(--crimson); color: var(--paper);
  border-radius: var(--r-md); padding: var(--s-4) var(--s-5);
  font-family: var(--head); font-weight: 700; font-size: 18px; line-height: 1.3;
  text-align: center;
}
.legal { margin-top: var(--s-4); font-size: 15px; color: var(--muted); }

/* ---------- липкая полоса действий: только на телефоне ---------- */

.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2);
  padding: var(--s-2) var(--s-3) calc(var(--s-2) + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--hair);
  box-shadow: 0 -4px 16px rgba(11,37,69,.10);
  backdrop-filter: blur(6px);
}
.sticky-cta .btn { min-height: 48px; padding: 0 var(--s-3); font-size: 16px; }
/* display:grid у класса сильнее браузерного [hidden]{display:none} —
   без этой строки атрибут hidden ничего не скрывает. */
.sticky-cta[hidden] { display: none; }
/* Чтобы полоса не накрывала подвал на последнем экране */
body { padding-bottom: 76px; }

@media (min-width: 768px) {
  .sticky-cta { display: none; }
  body { padding-bottom: 0; }
}

/* ---------- заявка принята ---------- */

.sent {
  background: var(--success-bg); border-left: 5px solid var(--success);
  border-radius: 0 var(--r-lg) var(--r-lg) 0; padding: var(--s-6);
}
.sent h3 { color: var(--success); margin-bottom: var(--s-3); }
.sent p { margin-bottom: var(--s-3); }
.sent .tel-line {
  font-family: var(--head); font-weight: 700; font-size: 26px; color: var(--navy);
  text-decoration: none; font-variant-numeric: lining-nums;
}

/* ---------- без JavaScript ---------- */

.nojs {
  background: var(--pink); border-left: 5px solid var(--crimson);
  border-radius: 0 var(--r-md) var(--r-md) 0; padding: var(--s-5); margin-bottom: var(--s-5);
}

/* ---------- подвал ---------- */

.foot { background: var(--navy-deep); color: var(--on-dark-soft); padding-block: var(--s-7) var(--s-6); position: relative; }
.foot::before {
  content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 60px;
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1080 60' preserveAspectRatio='none'>\
<path d='M0,20 C296,-6 760,2 1080,28 L1080,60 L0,60 Z' fill='%230A1C33'/>\
<path d='M0,26 C296,0 760,8 1080,34' stroke='%23C8102E' stroke-width='2.5' fill='none'/>\
</svg>");
  background-size: 100% 100%; background-repeat: no-repeat;
  transform: translateY(-100%);
}
.foot .cols { display: grid; gap: var(--s-5); }
.foot a { color: var(--on-dark); }
.legal-block {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid rgba(255,255,255,.14);
}
.legal-block .small { max-width: 90ch; }
.foot .claim {
  font-family: var(--mono); font-size: 13px; letter-spacing: .16em; color: var(--on-dark-muted);
  margin-top: var(--s-5);
}
.foot .claim i { color: var(--crimson); font-style: normal; padding: 0 6px; }
.foot .small { font-size: 14px; color: var(--on-dark-muted); margin-top: var(--s-4); }

/* ==========================================================
   Планшет и десктоп
   ========================================================== */

@media (min-width: 768px) {
  body { font-size: 18px; line-height: 1.6; }
  h1 { font-size: 56px; line-height: 1.06; font-weight: 800; }
  h2 { font-size: 36px; line-height: 1.14; }
  h3 { font-size: 26px; line-height: 1.2; }
  .rule { width: 92px; height: 5px; }
  .kicker { font-size: 14px; }
  .lead { font-size: 21px; }
  .note, .hint, .err, .consent label, form label { font-size: 16px; }
  section { padding-block: var(--s-9); }
  .wrap { padding: 0 var(--s-6); }

  .hero .grid { grid-template-columns: 1.2fr .8fr; gap: var(--s-7); }
  /* Имя центра длинное: на 56px заголовок рвётся на четыре строки. */
  .hero h1 { font-size: 46px; line-height: 1.08; }
  .hero .quote { font-size: 24px; }
  .top .tel { font-size: 22px; }

  .cards { grid-template-columns: repeat(3, 1fr); }
  .cards.four { grid-template-columns: repeat(2, 1fr); }
  .card { align-content: start; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .two { grid-template-columns: 1fr 1fr; gap: var(--s-5); }
  .form-grid { grid-template-columns: 1.2fr .8fr; gap: var(--s-8); }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
  .cta-strip { grid-template-columns: 1fr auto; padding: var(--s-6); }
  .cta-strip p { font-size: 21px; }
  .cta-strip .btn { width: auto; }
  .hero-sub { font-size: 22px; }
  .aside-call .tel-big { font-size: 40px; }
  .disclaimer { font-size: 20px; }
  .foot .cols { grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s-6); }
}

@media (min-width: 1024px) {
  .cards.four { grid-template-columns: repeat(4, 1fr); }
  .hero .grid { align-items: start; }
  .portrait img { max-height: 560px; }
}
