/* Семейная карта Bosco — анкета для планшета на кассе Ресторации.
   Стиль повторяет bosco.ru: Raleway, винный #97113C, графит #30333A,
   кремовый #FFFCE8, тонкие заголовки, много воздуха, прямые углы. */

:root {
  --wine: #97113C;
  --wine-deep: #7B0D31;
  --wine-soft: #F7E9EE;
  --ink: #30333A;
  --muted: #6E717A;
  --line: #D1D5DC;
  --line-soft: #E8EAEE;
  --cream: #FFFCE8;
  --paper: #FBFAF6;
  --bg: #FFFFFF;
  --ok: #2F7A4F;
  --pad: clamp(20px, 4vw, 48px);
  --nav-h: 88px;
  font-family: "Raleway", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-size: 17px;
  line-height: 1.45;
  font-variant-numeric: lining-nums;
  touch-action: manipulation;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
img { display: block; }

/* ── шапка ──────────────────────────────────────────────────────────────── */

.topline {
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  letter-spacing: .06em;
  text-align: center;
  padding: 7px 16px;
}
.header {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg);
  position: relative;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__cherry { width: 24px; height: 31px; }
.brand__word {
  color: var(--wine);
  font-size: 25px;
  font-weight: 300;
  letter-spacing: .01em;
}
.brand__word b { font-weight: 800; }
.header__right { display: flex; align-items: center; gap: 18px; }
.demo-badge {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--wine);
  border: 1px dashed var(--wine);
  padding: 5px 10px;
}
.link-btn {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 15px;
  padding: 10px 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.app { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ── приветствие ────────────────────────────────────────────────────────── */

.hero {
  flex: 1;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: var(--pad);
  min-height: calc(100dvh - 100px);
  background: #3a2a2a url("assets/terrace.webp") center 60% / cover no-repeat;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(20,8,12,.45) 100%);
}
.hero__panel {
  position: relative;
  z-index: 1;
  background: var(--wine);
  color: var(--cream);
  max-width: 560px;
  padding: 40px 44px 44px;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.5);
}
.hero__logo { width: 104px; height: 104px; margin-bottom: 26px; }
.hero__title {
  font-weight: 200;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.05;
  margin: 0 0 18px;
}
.hero__text { font-size: 18px; font-weight: 400; margin: 0 0 30px; opacity: .92; max-width: 440px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero__note { font-size: 13px; opacity: .75; }

/* ── кнопки ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 30px;
  border: 1px solid var(--wine);
  background: var(--wine);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .15s, color .15s, opacity .15s;
}
.btn:active { background: var(--wine-deep); }
.btn:disabled { opacity: .45; cursor: default; }
.btn--ghost { background: transparent; color: var(--wine); }
.btn--ghost:active { background: var(--wine-soft); }
.btn--cream { background: var(--cream); border-color: var(--cream); color: var(--wine); }
.btn--cream:active { background: #fff; }
.btn--ink { background: var(--ink); border-color: var(--ink); }
.btn .arrow { width: 22px; height: 16px; fill: currentColor; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading::after {
  content: "";
  width: 18px; height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── каркас шагов ───────────────────────────────────────────────────────── */

.flow {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(300px, 34%) 1fr;
  min-height: 0;
}
.aside {
  position: sticky;
  top: 0;
  height: calc(100dvh - 100px);
  background: #3a2a2a var(--photo, url("assets/hall.webp")) center / cover no-repeat;
  display: flex;
  align-items: flex-end;
  padding: 28px;
}
.aside__box {
  background: var(--wine);
  color: var(--cream);
  padding: 28px 28px 30px;
  width: 100%;
}
.aside--staff { --photo: none; background: var(--ink); align-items: stretch; }
.aside--staff .aside__box { background: transparent; padding: 12px 4px; display: flex; flex-direction: column; }
.aside__step { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .8; margin-bottom: 12px; }
.aside__title { font-weight: 200; font-size: 34px; line-height: 1.1; margin: 0 0 12px; }
.aside__hint { margin: 0; font-size: 15px; opacity: .9; }
.aside__cherry { width: 36px; height: 47px; margin-bottom: 26px; opacity: .9; }
.aside__foot { margin-top: auto; font-size: 13px; opacity: .6; }

.pane { display: flex; flex-direction: column; min-width: 0; }
.pane__body { flex: 1; padding: 30px var(--pad) 40px; max-width: 860px; width: 100%; }

.progress { display: flex; gap: 6px; margin-bottom: 30px; }
.progress__item { flex: 1; min-width: 0; }
.progress__bar { height: 3px; background: var(--line-soft); }
.progress__item.is-done .progress__bar,
.progress__item.is-current .progress__bar { background: var(--wine); }
.progress__label {
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.progress__item.is-current .progress__label { color: var(--wine); font-weight: 600; }

.h2 {
  font-weight: 200;
  font-size: clamp(30px, 3.6vw, 42px);
  line-height: 1.12;
  color: var(--wine);
  margin: 0 0 8px;
}
.lead { color: var(--muted); margin: 0 0 30px; font-size: 17px; max-width: 620px; }

.section { margin: 38px 0 0; }
.section:first-of-type { margin-top: 0; }
.section__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.section__note { font-size: 14px; color: var(--muted); margin: -8px 0 16px; }

.nav {
  position: sticky;
  bottom: 0;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--line-soft);
  padding: 14px var(--pad) calc(14px + env(safe-area-inset-bottom));
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  z-index: 4;
}
.nav__hint { color: var(--muted); font-size: 14px; flex: 1; text-align: center; }
.nav .btn { min-width: 170px; }

/* ── поля ───────────────────────────────────────────────────────────────── */

.grid { display: grid; gap: 30px 26px; grid-template-columns: repeat(6, 1fr); }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.col-2 { grid-column: span 2; }

/* Ошибка поля не сдвигает вёрстку: иначе на планшете касание кнопки ниже «промахивается». */
.field { display: flex; flex-direction: column; min-width: 0; position: relative; }
.field > .field__error { position: absolute; top: calc(100% + 5px); left: 0; right: 0; margin: 0; line-height: 1.2; }
.field__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.field__label .req { color: var(--wine); margin-left: 2px; }
.input {
  width: 100%;
  height: 54px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 6px 2px;
  font-size: 21px;
  font-weight: 500;
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder { color: #B5B8BF; font-weight: 400; }
.input:focus { border-bottom: 2px solid var(--wine); padding-bottom: 5px; }
.input[readonly] { color: var(--muted); }
.field__error { color: var(--wine); font-size: 14px; margin-top: 6px; font-weight: 500; }
.field.has-error .input { border-bottom: 2px solid var(--wine); padding-bottom: 5px; }
.field__hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

.verified {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ok);
  font-size: 14px;
  font-weight: 600;
  margin-top: 6px;
}
.verified svg { width: 16px; height: 16px; fill: currentColor; }

/* чипы — выбор одного или нескольких вариантов */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 16px;
  font-weight: 500;
  user-select: none;
  transition: background .12s, border-color .12s, color .12s;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip__tick {
  width: 18px; height: 18px;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  flex: none;
}
.chip__tick svg { width: 14px; height: 14px; fill: #fff; opacity: 0; }
.chip.is-on { border-color: var(--wine); background: var(--wine); color: #fff; }
.chip.is-on .chip__tick { border-color: rgba(255,255,255,.7); }
.chip.is-on .chip__tick svg { opacity: 1; }
.chip--radio .chip__tick { border-radius: 50%; }
/* Рамка фокуса — только при управлении с клавиатуры, на планшете её не видно. */
.chip:has(input:focus-visible) { outline: 2px solid var(--wine); outline-offset: 2px; }

/* шкалы 1–5 и 1–3 — как квадратики в бумажной анкете */
.scale-list { display: flex; flex-direction: column; }
.scale-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.scale-row__label { font-size: 17px; font-weight: 500; }
.scale { display: flex; gap: 8px; flex: none; }
.scale button {
  width: 52px; height: 52px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 19px;
  font-weight: 600;
  transition: background .12s, border-color .12s, color .12s;
}
.scale button.is-on { background: var(--wine); border-color: var(--wine); color: #fff; }
.scale-legend { display: flex; justify-content: flex-end; gap: 18px; color: var(--muted); font-size: 13px; margin-top: 10px; }

/* дети */
.kids { display: flex; flex-direction: column; gap: 30px; }
.kid { display: grid; grid-template-columns: 1fr 140px 52px; gap: 18px; align-items: end; }
.kid .field { grid-column: auto; }
.icon-btn {
  width: 52px; height: 52px;
  border: 1px solid var(--line);
  background: var(--bg);
  display: grid; place-items: center;
  color: var(--muted);
}
.icon-btn svg { width: 16px; height: 16px; fill: currentColor; }
.add-btn {
  align-self: flex-start;
  border: 1px dashed var(--wine);
  background: transparent;
  color: var(--wine);
  min-height: 50px;
  padding: 0 20px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .04em;
}

/* телефон и код */
.phone-block { max-width: 520px; }
.input--xl { font-size: 32px; height: 70px; letter-spacing: .02em; }
.otp { max-width: 520px; margin-top: 30px; }
.otp .input { font-size: 40px; letter-spacing: .5em; height: 78px; font-weight: 600; }
.demo-code {
  margin-top: 18px;
  border: 1px dashed var(--wine);
  background: var(--wine-soft);
  padding: 14px 18px;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
}
.demo-code b { font-size: 24px; letter-spacing: .2em; color: var(--wine); }
.resend { margin-top: 18px; font-size: 15px; color: var(--muted); }
.resend button { border: 0; background: none; color: var(--wine); font-weight: 600; padding: 8px 0; text-decoration: underline; text-underline-offset: 4px; }

/* выбор карты */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.card-opt {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 22px 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: border-color .15s, box-shadow .15s;
}
.card-opt.is-on { border-color: var(--wine); box-shadow: inset 0 0 0 1px var(--wine); }
.card-opt__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-opt__title { font-size: 22px; font-weight: 600; color: var(--ink); }
.card-opt__text { color: var(--muted); font-size: 15px; margin: 0; }
.radio-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  flex: none;
  display: grid; place-items: center;
}
.card-opt.is-on .radio-dot { border-color: var(--wine); }
.card-opt.is-on .radio-dot::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--wine); }

/* сама карта */
.fcard {
  position: relative;
  aspect-ratio: 1.586;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  color: var(--cream);
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(255,255,255,.14), rgba(255,255,255,0) 55%),
    linear-gradient(135deg, #A3163F 0%, #8A0F36 55%, #6E0A2A 100%);
  box-shadow: 0 18px 40px -18px rgba(90,8,34,.55), inset 0 0 0 1px rgba(255,255,255,.08);
  container-type: inline-size;
}
.fcard::before {
  content: "";
  position: absolute;
  right: -6%;
  bottom: -18%;
  width: 52%;
  aspect-ratio: 30 / 39;
  background: url("assets/cherry-cream.svg") center / contain no-repeat;
  opacity: .08;
}
.fcard__logo { position: absolute; left: 6.5%; top: 11%; width: 27%; }
.fcard__kind {
  position: absolute; right: 6.5%; top: 11%;
  font-size: 4.2cqw; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; opacity: .9;
  text-align: right; line-height: 1.3;
}
.fcard__kind small { display: block; font-weight: 400; letter-spacing: .12em; opacity: .75; font-size: 3.4cqw; }
.fcard__num {
  position: absolute; left: 6.5%; bottom: 11%;
  font-size: 7.2cqw; letter-spacing: .14em; font-weight: 500;
}
.fcard__type {
  position: absolute; right: 6.5%; bottom: 12%;
  font-size: 3.6cqw; letter-spacing: .14em; text-transform: uppercase; opacity: .8;
}

/* согласие и подпись */
.consent-text {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  padding: 20px 22px;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.55;
  margin: 0 0 18px;
}
.check {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 17px;
  font-weight: 500;
  padding: 10px 0;
  cursor: pointer;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box {
  width: 30px; height: 30px;
  border: 1px solid var(--line);
  flex: none;
  display: grid; place-items: center;
  background: var(--bg);
}
.check__box svg { width: 20px; height: 20px; fill: #fff; opacity: 0; }
.check.is-on .check__box { background: var(--wine); border-color: var(--wine); }
.check.is-on .check__box svg { opacity: 1; }
.check.has-error .check__box { border: 2px solid var(--wine); }

.sign {
  position: relative;
  border: 1px solid var(--line);
  background: var(--cream);
  height: 240px;
  touch-action: none;
}
.sign canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sign__line {
  position: absolute; left: 28px; right: 28px; bottom: 64px;
  border-bottom: 1px solid rgba(48,51,58,.35);
  pointer-events: none;
}
.sign__hint {
  position: absolute; left: 28px; bottom: 34px;
  font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  pointer-events: none;
}
.sign__clear {
  position: absolute; right: 12px; top: 12px;
  border: 1px solid var(--line); background: #fff;
  font-size: 14px; padding: 8px 14px; font-weight: 600;
}
.sign.has-error { border: 2px solid var(--wine); }
.sign-meta { display: flex; justify-content: space-between; margin-top: 10px; color: var(--muted); font-size: 14px; }

/* шаг сотрудника */
.summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 26px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  padding: 20px 22px;
  font-size: 16px;
}
.summary dt { color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; padding-top: 3px; }
.summary dd { margin: 0; font-weight: 600; }
.scan-hint { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin-top: 8px; }

/* готово */
.done {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(28px, 5vw, 80px);
  padding: clamp(28px, 5vw, 70px) var(--pad);
  background: linear-gradient(180deg, var(--paper), #fff);
}
.done__card { max-width: 520px; width: 100%; justify-self: end; animation: rise .6s cubic-bezier(.2,.7,.2,1); }
@keyframes rise { from { transform: translateY(24px) rotate(-2deg); opacity: 0; } to { transform: none; opacity: 1; } }
.done__title { font-weight: 200; font-size: clamp(36px, 4.4vw, 54px); color: var(--wine); line-height: 1.05; margin: 0 0 16px; }
.done__text { font-size: 18px; margin: 0 0 24px; max-width: 480px; }
.done__list { list-style: none; padding: 0; margin: 0 0 30px; display: grid; gap: 10px; }
.done__list li { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; }
.done__list svg { width: 20px; height: 20px; fill: var(--wine); flex: none; margin-top: 2px; }
.done__timer { color: var(--muted); font-size: 14px; margin-top: 14px; }

/* модалка и тост */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(30,32,37,.55);
  display: grid; place-items: center;
  padding: 20px;
}
.modal__box { background: #fff; max-width: 480px; width: 100%; padding: 34px 32px 28px; }
.modal__title { font-weight: 300; font-size: 30px; color: var(--wine); margin: 0 0 10px; line-height: 1.15; }
.modal__text { margin: 0 0 26px; color: var(--ink); }
.modal__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.modal__actions .btn { flex: 1; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%);
  z-index: 60;
  background: var(--ink); color: #fff;
  padding: 14px 22px;
  max-width: min(92vw, 620px);
  font-size: 15px;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.4);
}
.toast.is-error { background: var(--wine); }

/* ── адаптив: портрет планшета и телефоны ───────────────────────────────── */

@media (max-width: 999px), (orientation: portrait) {
  .flow { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .aside {
    position: static;
    height: auto;
    padding: 0;
    background: var(--wine);
  }
  .aside--staff { background: var(--ink); }
  .aside__box { padding: 18px var(--pad); display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
  .aside__title { font-size: 26px; margin: 0; }
  .aside__step { margin: 0; }
  .aside__hint, .aside__cherry, .aside__foot { display: none; }
  .progress__label { display: none; }
  .done { grid-template-columns: 1fr; text-align: left; }
  .done__card { justify-self: center; max-width: 440px; }
}

@media (max-width: 640px) {
  :root { --nav-h: 76px; }
  body { font-size: 16px; }
  .topline { display: none; }
  .header { height: 58px; }
  .brand__word { font-size: 21px; }
  .demo-badge { display: none; }
  .hero__panel { padding: 28px 24px 30px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 28px 18px; }
  .col-6, .col-4 { grid-column: span 2; }
  .col-3, .col-2 { grid-column: span 1; }
  .cards { grid-template-columns: 1fr; }
  .scale-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .scale button { width: 48px; height: 48px; }
  .kid { grid-template-columns: 1fr 90px 52px; gap: 12px; }
  .nav .btn { min-width: 0; flex: 1; padding: 0 16px; }
  .nav__hint { display: none; }
  .summary { grid-template-columns: 1fr; gap: 2px; }
  .summary dd { margin-bottom: 10px; }
}
