/* Экраны терминала самообслуживания.
   Крупные интерактивные элементы, минимум ввода с клавиатуры (ТЗ п. 2.3).
   Цвета — роли дизайн-системы: красный ведёт к главному действию, зелёный
   подтверждает и показывает путь. Поверхности белые, без жирных рамок:
   глубину дают тени, а не обводки. */

body { overflow-x: hidden; }

.kiosk {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

/* --- Шапка ----------------------------------------------------------- */
.kiosk-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 var(--line-soft);
}
/* Фирменная полоса под шапкой: красный и зелёный логотипа встык. */
.kiosk-header::after {
  content: "";
  display: block;
  height: 4px;
  background: var(--brand-stripe);
}

.kiosk-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  width: min(1440px, calc(100% - 64px));
  margin: 0 auto;
  min-height: 88px;
}

.kiosk-header__center { display: flex; justify-content: center; }

.session-badge {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 7px 8px 7px 18px;
  border-radius: var(--radius-pill);
  background: var(--red-50);
  color: var(--red-900);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px rgba(218, 73, 69, .2);
}
.session-badge.is-visible { display: inline-flex; }
.session-badge__timer {
  min-width: 54px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  color: var(--white);
  background: var(--primary-gradient);
  font-size: 14px;
  text-align: center;
}

.kiosk-header__actions { display: flex; align-items: center; gap: 12px; }

/* --- Основная область ------------------------------------------------ */
.kiosk-main {
  width: min(1440px, calc(100% - 64px));
  margin: 0 auto;
  padding: 30px 0 40px;
}

.screen { display: none; animation: screen-in .35s var(--ease); }
.screen.is-active { display: block; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Шапка экрана: «Назад» — слева, перед заголовком, где его ищут глазами
   и куда тянется рука; заголовок рядом, справа свободно. */
.screen-head {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
}
.screen-head > .btn {
  order: -1;
  flex: 0 0 auto;
  min-height: 68px;
  padding: 0 26px 0 20px;
}
.screen-head > div { flex: 1 1 auto; min-width: 0; }
.screen-head h2 { font-size: clamp(30px, 2.8vw, 42px); }
.screen-head p { margin: 6px 0 0; }

.screen-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--red-700);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.screen-kicker::before {
  content: "";
  width: 22px;
  height: 4px;
  border-radius: 2px;
  background: var(--brand-stripe);
}
.screen-kicker:empty { display: none; }

/* --- Главный экран ---------------------------------------------------- */
.home { display: grid; }

/* Сцена-приветствие на всю ширину экрана: глубокий красный, точечный узор
   справа, зелёная кромка снизу. Плитки ниже наплывают на её край. */
.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 40px;
  margin: -30px calc(50% - 50vw) 0;
  padding: 46px calc(50vw - 50%) 112px;
  overflow: hidden;
  isolation: isolate;
  color: var(--white);
  background:
    linear-gradient(var(--green-800), var(--green-800)) left bottom / 100% 6px no-repeat,
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, .20), transparent 26rem),
    radial-gradient(circle at 12% 120%, rgba(255, 120, 110, .35), transparent 30rem),
    var(--scene-gradient);
}
.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(rgba(255, 255, 255, .22) 1.3px, transparent 1.8px) 0 0 / 26px 26px;
  -webkit-mask-image: linear-gradient(100deg, transparent 35%, #000 85%);
  mask-image: linear-gradient(100deg, transparent 35%, #000 85%);
}
/* Крупное сердце-контур — знак логотипа, едва заметный на фоне. */
.home-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: max(-80px, calc(50% - 50vw + 40px));
  top: -120px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  border: 70px solid rgba(255, 255, 255, .05);
}

.home-hero h1 {
  margin: 16px 0 12px;
  color: var(--white);
  font-size: clamp(42px, 4vw, 64px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.045em;
}
.home-hero h1 .accent { color: var(--white); }
/* Вторая часть приветствия — мягче первой; зелёная черта под заголовком. */
.home-hero h1 > span:last-child { color: rgba(255, 255, 255, .78); }
.home-hero h1::after {
  content: "";
  display: block;
  width: 84px;
  height: 6px;
  margin-top: 18px;
  border-radius: 3px;
  background: var(--secondary-gradient);
}
.home-hero .lead {
  max-width: 780px;
  margin: 0;
  color: rgba(255, 255, 255, .86);
  font-size: 19px;
  line-height: 1.5;
}

.eyebrow--on-red {
  color: var(--white);
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .28);
  backdrop-filter: blur(6px);
}

.home-hero__clock {
  display: grid;
  justify-items: end;
  gap: 4px;
  padding-left: 40px;
  border-left: 1px solid rgba(255, 255, 255, .22);
  text-align: right;
}
.home-hero__time {
  font-size: 104px;
  font-weight: 250;
  line-height: .95;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
}
.home-hero__date {
  color: rgba(255, 255, 255, .8);
  font-size: 20px;
  font-weight: 500;
}
.home-hero__date::first-letter { text-transform: uppercase; }

.quick-actions {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: -72px;
}

.quick-action {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 18px;
  row-gap: 2px;
  align-items: center;
  padding: 22px 20px 22px 22px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  text-align: left;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.quick-action:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(31, 28, 27, .04), 0 34px 70px -18px rgba(31, 28, 27, .28); }
.quick-action:active { transform: scale(.98); }
.quick-action strong { grid-column: 2; align-self: end; color: var(--ink-900); font-size: 20px; font-weight: 650; line-height: 1.2; letter-spacing: -.02em; }
.quick-action > span:not(.quick-action__icon) { grid-column: 2; align-self: start; color: var(--ink-600); font-size: 15px; }
.quick-action__icon {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 20px;
  color: var(--green-900);
  background: var(--green-100);
  transition: background .25s var(--ease), color .25s var(--ease);
}
.quick-action__go {
  grid-column: 3;
  grid-row: 1 / span 2;
  width: 40px;
  height: 40px;
  padding: 10px;
  border-radius: 50%;
  color: var(--ink-500);
  background: var(--ink-100);
  stroke-width: 2.4;
  transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.quick-action:hover .quick-action__icon { color: var(--white); background: var(--secondary-gradient); }
.quick-action:hover .quick-action__go { color: var(--white); background: var(--primary-gradient); transform: translateX(3px); }

/* --- Ввод ИИН и клавиатура -------------------------------------------- */
.iin-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
  gap: 44px;
  align-items: center;
  width: min(1220px, 100%);
  margin: 28px auto 0;
  padding: 32px 36px 32px 44px;
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.iin-panel__intro h3 { font-size: 38px; font-weight: 700; letter-spacing: -.035em; }
.iin-panel__intro .muted { margin: 8px 0 0; font-size: 17px; }

.iin-panel__step {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  border-radius: 16px;
  color: var(--white);
  background: var(--primary-gradient);
  box-shadow: var(--shadow-red);
}
.iin-panel__step .icon { width: 24px; height: 24px; }

.iin-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 104px;
  margin: 26px 0 14px;
  padding: 0 18px;
  border-radius: 24px;
  background: var(--ink-100);
  border: 2px solid transparent;
  transition: .2s var(--ease);
}
.iin-panel.is-filled .iin-display { background: var(--green-50); border-color: var(--green-800); box-shadow: 0 0 0 6px rgba(27, 169, 91, .12); }
.iin-panel.is-error .iin-display { background: var(--red-50); border-color: var(--red-700); box-shadow: 0 0 0 6px rgba(218, 73, 69, .14); animation: shake .4s; }

@keyframes shake {
  25% { transform: translateX(-7px); }
  50% { transform: translateX(7px); }
  75% { transform: translateX(-4px); }
}

.iin-cell {
  width: 40px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--white);
  color: var(--ink-300);
  box-shadow: var(--shadow-xs);
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
/* Группы ИИН: дата рождения (6) · остальное — отступ после шестой цифры. */
.iin-cell:nth-child(6) { margin-right: 12px; }
.iin-cell.is-filled { color: var(--ink-900); }
.iin-panel.is-filled .iin-cell { color: var(--green-950); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.key {
  display: grid;
  place-items: center;
  min-height: 80px;
  border: 0;
  border-radius: 22px;
  background: var(--ink-100);
  color: var(--ink-900);
  font-size: 32px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: .15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.key .icon { width: 32px; height: 32px; stroke-width: 2.4; }
.key:hover { background: #efeae8; }
.key:active { transform: scale(.95); background: var(--white); box-shadow: var(--shadow-sm); }
.key--action { color: var(--white); background: var(--secondary-gradient); box-shadow: var(--shadow-green); }
.key--action:hover { background: var(--secondary-gradient); filter: brightness(1.05); }
.key--danger { color: var(--red-700); background: var(--red-50); }
.key--danger:hover { background: var(--red-100); }

/* --- Сетки карточек ---------------------------------------------------- */
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.tile {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 132px;
  padding: 24px 24px 24px 30px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
/* Цветная кромка слева: зелёная в покое, красная под пальцем и в выборе. */
.tile::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--secondary-gradient);
  transition: width .25s var(--ease), background .25s var(--ease);
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tile:hover::before, .tile.is-selected::before { width: 8px; background: var(--primary-gradient); }
.tile.is-selected { box-shadow: 0 0 0 3px var(--red-600), var(--shadow-md); }
.tile strong { font-size: 20px; font-weight: 650; line-height: 1.25; letter-spacing: -.02em; }
.tile span { color: var(--ink-600); font-size: 15px; }
.tile__price { color: var(--red-700); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }

/* На экране выбора остаются только направления с реальной записью.
   Подпись под названием показывает ближайшее свободное время. */
.tile__meta {
  position: relative;
  display: block;
  margin-top: 4px;
  padding-left: 18px;
  font-size: 15px;
  font-weight: 500;
  color: var(--green-900) !important;
  line-height: 1.35;
}
/* Зелёная точка — «есть свободное время». */
.tile__meta::before {
  content: "";
  position: absolute;
  left: 0;
  top: .45em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green-800);
  box-shadow: 0 0 0 4px rgba(27, 169, 91, .15);
}

/* «Что дальше» на подтверждении: текст под заголовком, кнопка — внизу,
   вровень с итогом слева. */
#screen-confirm .grid--2 > .panel { position: relative; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
#screen-confirm .grid--2 > .panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: var(--primary-gradient); }
#screen-confirm .grid--2 > .panel p { margin: 0; font-size: 17px; }
#screen-confirm .grid--2 > .panel .btn { margin-top: auto; }
.grid__note {
  margin: 18px 0 2px;
  font-size: 16px;
  color: var(--ink-600);
}

/* --- Карточка записи --------------------------------------------------- */
.reception-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 14px 28px;
  align-items: center;
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

/* Время — первым, слева: по нему пациент узнаёт свою запись. Сумма и
   кнопки — справа, друг под другом. Обёртка из JS растворяется в сетке. */
.reception-card__side { display: contents; }
.reception-card__side > .when-badge { grid-column: 1; grid-row: 1 / span 2; }
.reception-card__body { grid-column: 2; grid-row: 1 / span 2; display: grid; gap: 10px; }
.reception-card__side > .reception-card__sum { grid-column: 3; grid-row: 1; align-self: end; justify-self: end; }
.reception-card__side > .row { grid-column: 3; grid-row: 2; align-self: start; justify-content: flex-end; flex-wrap: nowrap; }
.reception-card__title { font-size: 24px; font-weight: 700; letter-spacing: -.025em; }
.reception-card__meta { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--ink-600); font-size: 16px; }
.reception-card__meta b { color: var(--ink-800); font-weight: 600; }
.reception-card__sum { color: var(--red-700); font-size: 30px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.when-badge {
  display: grid;
  place-items: center;
  gap: 4px;
  min-width: 124px;
  padding: 20px 18px;
  border-radius: 24px;
  color: var(--white);
  background: var(--primary-gradient);
  box-shadow: var(--shadow-red);
}
.when-badge strong { font-size: 32px; font-weight: 650; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.when-badge span { font-size: 13px; opacity: .9; }

/* --- Слоты времени ----------------------------------------------------- */
.slots { display: flex; flex-wrap: wrap; gap: 10px; }

.slot {
  min-width: 108px;
  min-height: 62px;
  padding: 12px 18px;
  border: 0;
  border-radius: 18px;
  background: var(--green-50);
  color: var(--green-950);
  box-shadow: inset 0 0 0 1.5px rgba(27, 169, 91, .25);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: .18s var(--ease);
}
.slot:hover { background: var(--green-100); transform: translateY(-2px); }
.slot.is-selected { color: var(--white); background: var(--primary-gradient); box-shadow: var(--shadow-red); }

/* --- Шаги записи ------------------------------------------------------- */
.steps {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 24px;
  padding: 6px;
  width: fit-content;
  max-width: 100%;
  border-radius: var(--radius-pill);
  background: var(--white);
  box-shadow: var(--shadow-xs);
  flex-wrap: wrap;
}
.steps:empty { display: none; }

.step {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px 9px 9px;
  border-radius: var(--radius-pill);
  color: var(--ink-500);
  font-size: 15px;
  font-weight: 600;
}
.step.is-done { color: var(--green-900); }
.step.is-current { color: var(--white); background: var(--primary-gradient); box-shadow: 0 8px 18px -6px rgba(218, 73, 69, .6); }
.step__num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink-100);
  font-size: 13px;
  font-weight: 700;
}
.step.is-done .step__num { color: var(--white); background: var(--green-800); }
.step.is-current .step__num { color: var(--red-700); background: var(--white); }

/* --- Итог и оплата ------------------------------------------------------ */
.summary {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 34px 30px 30px;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.summary::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: var(--secondary-gradient);
}
.summary__row { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); font-size: 17px; }
.summary__row b { font-weight: 600; text-align: right; }
.summary__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 4px;
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--red-50);
  font-size: 24px;
  font-weight: 700;
  color: var(--red-800);
  font-variant-numeric: tabular-nums;
}

.pos-visual {
  position: relative;
  display: grid;
  place-items: center;
  gap: 20px;
  padding: 50px 30px 46px;
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-md);
  text-align: center;
  overflow: hidden;
}
.pos-visual::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: var(--primary-gradient);
}

.pos-visual__pulse {
  display: grid;
  place-items: center;
  width: 144px;
  height: 144px;
  border-radius: 50%;
  color: var(--white);
  background: var(--primary-gradient);
  box-shadow: 0 0 0 0 rgba(218, 73, 69, .45);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 34px rgba(218, 73, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(218, 73, 69, 0); }
}

/* Успех — зелёный, отказ — тёмно-красный: пульсация прекращается,
   состояние окончательное. */
.pos-visual.is-success::before { background: var(--secondary-gradient); }
.pos-visual.is-success .pos-visual__pulse { background: var(--secondary-gradient); animation: pop .45s var(--ease); }
.pos-visual.is-failed::before { background: var(--red-900); }
.pos-visual.is-failed .pos-visual__pulse {
  background: linear-gradient(135deg, var(--red-800), var(--red-950));
  animation: pop .45s var(--ease);
}
.pos-visual.is-failed h3 { color: var(--red-800); }

@keyframes pop {
  0% { transform: scale(.82); opacity: .4; }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}

/* Индикатор ожидания: показывает, что операция идёт, без обратного отсчёта —
   торопить пациента у платёжного терминала не нужно. */
.pos-progress {
  width: min(320px, 80%);
  height: 8px;
  border-radius: 99px;
  background: var(--red-100);
  overflow: hidden;
}

.pos-progress span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 99px;
  background: var(--brand-stripe);
  animation: slide 1.4s infinite var(--ease);
}

@keyframes slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(260%); }
}

/* --- Талон -------------------------------------------------------------- */
.ticket {
  position: relative;
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 0 40px 30px;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.ticket::before {
  content: "";
  display: block;
  height: 10px;
  margin: 0 -40px 30px;
  background: var(--brand-stripe);
}

.ticket::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 84px;
  border-top: 2px dashed var(--ink-300);
}

.ticket__logo { width: 156px; margin: 0 auto 18px; }

.ticket__number {
  margin: 10px 0 6px;
  color: var(--red-700);
  font-size: 88px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.05em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ticket__rows { display: grid; gap: 12px; margin: 26px 0 30px; }
.ticket__row { display: flex; justify-content: space-between; gap: 18px; font-size: 17px; }
.ticket__row span { color: var(--ink-600); }
.ticket__row b { font-weight: 600; text-align: right; }
.ticket__footer { padding-top: 26px; color: var(--green-900); font-size: 14px; font-weight: 600; text-align: center; }

/* --- Прайс -------------------------------------------------------------- */
/* Группа — строка-аккордеон: название слева, число услуг и вилка цен
   справа. Раскрытая группа отмечена красной кромкой. */
.price-group {
  margin-bottom: 12px;
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.price-group:last-child { margin-bottom: 0; }

.price-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  min-height: 76px;
  padding: 14px 24px 14px 26px;
  border: 0;
  border-left: 6px solid var(--green-800);
  background: transparent;
  color: var(--ink-900);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.price-group__head h3 { font-size: 21px; font-weight: 650; }
.price-group__head::after {
  content: "";
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin-left: 6px;
  border-right: 3px solid var(--ink-500);
  border-bottom: 3px solid var(--ink-500);
  transform: rotate(45deg) translateY(-4px);
  transition: transform .2s var(--ease);
}
.price-group__meta {
  margin-left: auto;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  color: var(--green-900);
  background: var(--green-50);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.price-group__head[aria-expanded="true"] { border-left-color: var(--red-600); background: var(--red-50); }
.price-group__head[aria-expanded="true"]::after { border-color: var(--red-700); transform: rotate(-135deg) translate(-4px, 0); }
.price-group__body { border-top: 1px solid var(--line-soft); }

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 26px 16px 32px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 17px;
}
.price-row:last-child { border-bottom: 0; }
.price-row b { color: var(--red-700); font-size: 19px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Подзаголовок карточки сайта внутри раздела прайса («Врач КТ», «Врач МРТ»). */
.price-sub {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 26px 10px 32px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--white, #fff);
  color: var(--ink-600, #5b6470);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Карточки справочной: зелёная кромка, заголовок — красный. */
#info-grid > .card { position: relative; border: 0; padding-left: 34px; overflow: hidden; }
#info-grid > .card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--secondary-gradient); }
#info-grid > .card h3 { color: var(--red-800); }

/* --- Подвал ------------------------------------------------------------- */
.kiosk-footer {
  color: rgba(255, 255, 255, .78);
  background: linear-gradient(90deg, #0d3d23, #13623a);
}

.kiosk-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1440px, calc(100% - 64px));
  margin: 0 auto;
  min-height: 60px;
  font-size: 14px;
}
.kiosk-footer .icon { color: var(--green-400); }
#footer-clock { color: var(--white); font-weight: 600; font-variant-numeric: tabular-nums; }

/* --- Модальные окна и служебное ------------------------------------------ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 30px;
  background: rgba(40, 18, 16, .45);
  backdrop-filter: blur(8px);
}
.overlay.is-open { display: grid; }

.modal {
  width: min(580px, 100%);
  padding: 0 36px 36px;
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-lg);
  text-align: center;
  overflow: hidden;
  animation: modal-in .3s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.modal::before {
  content: "";
  display: block;
  height: 8px;
  margin: 0 -36px 32px;
  background: var(--brand-stripe);
}
.modal h3 { margin-bottom: 12px; font-size: 28px; }
.modal p { font-size: 17px; }
.modal__actions { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }

.spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  border: 6px solid var(--ink-100);
  border-top-color: var(--red-600);
  border-right-color: var(--green-800);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Шапка списка записей: приветствие слева, действия справа — над карточками. */
.patient-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 8px;
  padding: 26px 30px 26px 36px;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.patient-head::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--primary-gradient); }
.patient-head h2 { font-size: clamp(26px, 2.4vw, 34px); }
.patient-head p { margin: 6px 0 0; }
.patient-head > .row { flex-wrap: nowrap; flex-shrink: 0; }

.empty-state {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 60px 30px 56px;
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-md);
  text-align: center;
  overflow: hidden;
}
.empty-state::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: var(--brand-stripe); }
.empty-state > .icon {
  width: 96px;
  height: 96px;
  padding: 24px;
  border-radius: 30px;
  color: var(--green-900);
  background: var(--green-100);
}
.empty-state__icon { font-size: 56px; }
/* Приветствие с полным ФИО — длинная строка: на широком киоске её нужно
   держать в читаемой колонке, иначе фраза растягивается через весь экран. */
.empty-state h3, .empty-state p { max-width: 680px; }
.empty-state h3 { font-size: 30px; letter-spacing: -.03em; }
.empty-state p { margin: 0; font-size: 17px; }
.empty-state .row { justify-content: center; margin-top: 10px; }

/* Поле поиска с иконкой внутри */
.search-field { position: relative; display: flex; align-items: center; }
.search-field .icon {
  position: absolute;
  left: 24px;
  color: var(--red-600);
  pointer-events: none;
}
.search-field .input {
  padding-left: 64px;
  min-height: 76px;
  font-size: 20px;
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

/* --- Форма регистрации пациента ---------------------------------------- */
.form { position: relative; display: grid; gap: 20px; padding-top: 38px; overflow: hidden; }
.form::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: var(--primary-gradient); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form__row--summary {
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  background: var(--green-50);
}
.form__row--summary b { font-size: 20px; color: var(--green-900); letter-spacing: .02em; font-variant-numeric: tabular-nums; }

.field { display: grid; gap: 8px; }
.field__label { color: var(--ink-600); font-size: 15px; font-weight: 600; }
/* Пальцем по стеклу промахнуться легко — поля крупнее обычных. */
.form .input { min-height: 64px; font-size: 19px; }
.form .input.is-error { border-color: var(--red-700); background: var(--red-50); box-shadow: 0 0 0 4px rgba(218, 73, 69, .14); }

.demo-ribbon {
  position: fixed;
  right: -54px;
  top: 30px;
  z-index: 80;
  padding: 8px 60px;
  color: var(--white);
  background: linear-gradient(135deg, var(--green-800), var(--green-950));
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  transform: rotate(45deg);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}

.skeleton {
  height: 120px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--ink-100) 25%, var(--white) 50%, var(--ink-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* --- Страница ошибки (error.html) ----------------------------------------- */
.error-page { display: grid; place-items: center; }
.error-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(640px, 100%);
  padding: 0 40px 42px;
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-md);
  text-align: center;
  overflow: hidden;
}
.error-card::before {
  content: "";
  display: block;
  justify-self: stretch;
  height: 10px;
  margin: 0 -40px 32px;
  background: var(--brand-stripe);
}
.error-card__icon {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin-bottom: 8px;
  border-radius: 30px;
  color: var(--white);
  background: var(--primary-gradient);
  box-shadow: var(--shadow-red);
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
}
.error-card h2 { margin: 0; }
.error-card p { margin: 6px 0 14px; font-size: 18px; }

/* --- Адаптив: терминалы бывают и вертикальные ---------------------------- */
@media (max-width: 1180px) {
  /* Вертикальный терминал: в шапке нужно место под значок сессии. */
  .kiosk-header .brand-divider, .kiosk-header .brand-caption { display: none; }
  .kiosk-header .brand__logo { width: 168px; }
  .kiosk-header__actions .btn { white-space: nowrap; padding: 14px 20px; }
  .lang-switch button { min-width: 54px; padding: 12px 12px; }
  .home-hero { grid-template-columns: 1fr; padding-bottom: 100px; }
  .home-hero__clock { justify-items: start; padding: 18px 0 0; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .22); text-align: left; }
  .home-hero__time { font-size: 72px; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(3, 1fr); }
  .iin-panel { grid-template-columns: 1fr; padding: 34px; }
  .iin-panel__intro { text-align: center; }
  .key { min-height: 96px; font-size: 36px; }
}

@media (max-width: 860px) {
  .kiosk-header__inner, .kiosk-main, .kiosk-footer__inner { width: calc(100% - 32px); }
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .reception-card { grid-template-columns: auto 1fr; grid-template-rows: auto; }
  .reception-card__side > .when-badge, .reception-card__body { grid-row: auto; }
  .reception-card__side > :not(.when-badge) { grid-column: 1 / -1; grid-row: auto; justify-self: start; }
  .form__row { grid-template-columns: 1fr; }
  .patient-head { flex-direction: column; align-items: stretch; }
  .screen-head { flex-wrap: wrap; }
}
