/* ============================================================
   WILDWOOD — виджет онлайн-записи (общий для сайта и страницы /zapis)
   Форма записи, слоты, допы, купон «первый визит», экран «Вы записаны».
   Подключается и из index.html, и из book.html; цвета берутся из токенов :root страницы
   (--taiga, --resin, --bone, --pine-line …), поэтому вид у обеих страниц один.
   ============================================================ */

.form-card { background: var(--taiga); color: var(--bone); border-radius: var(--r-lg); padding: clamp(26px, 3.5vw, 44px);
  box-shadow: var(--shadow-float); will-change: transform; }
.form-card h3 { font-size: 1.7rem; font-weight: 500; }
.form-card .card-sub { color: rgba(240,233,217,.72); font-size: 15px; margin: 8px 0 26px; }
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; letter-spacing: .02em; color: rgba(240,233,217,.9); }
.field .req { color: var(--resin); }
.field .opt { color: rgba(240,233,217,.5); font-weight: 500; }
.control { width: 100%; font: inherit; font-size: 16px; padding: 14px 16px; border-radius: var(--r-sm);
  border: 1.5px solid var(--pine-line); background: var(--taiga-deep); color: var(--bone); transition: border-color .25s, box-shadow .25s; appearance: none; }
.control::placeholder { color: rgba(240,233,217,.48); }
.control { text-overflow: ellipsis; } /* длинная подсказка на телефоне заканчивается «…», а не обрезается посреди слова */
.control:focus { outline: none; border-color: var(--resin); box-shadow: 0 0 0 4px rgba(201,146,74,.18); }
select.control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23C9924A' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; padding-right: 42px; }
select.control { color-scheme: dark; }
select.control option, select.control optgroup { background-color: #1f1610; color: #f2e7d4; }
/* Поле даты открывает календарь по клику в любом месте. Родной значок растянут на всё поле и невидим, свой нарисован справа:
   раньше значок был чёрным на тёмном фоне, а клик по цифрам даты ничего не открывал (app.js ещё вызывает showPicker). */
input.control[type="date"] { position: relative; color-scheme: dark; cursor: pointer; padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23C9924A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='2.5'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; }
input.control[type="date"]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.slot { padding: 11px 6px; border-radius: 9px; border: 1.5px solid var(--pine-line); background: var(--taiga-deep); font-size: 15px; font-weight: 500; color: var(--bone); text-align: center; transition: all .2s var(--ease); }
.slot:hover { border-color: var(--resin); transform: translateY(-1px); }
.slot.active { background: var(--resin); border-color: var(--resin); color: var(--taiga-deep); }
.slots-empty { grid-column: 1/-1; font-size: 14px; color: rgba(240,233,217,.6); padding: 4px 0; }
.form-note { font-size: 12.5px; color: rgba(240,233,217,.55); margin-top: 8px; }
.form-msg { display: none; margin-top: 4px; padding: 14px 16px; border-radius: var(--r-sm); font-size: 14.5px; }
.form-msg.err { display: block; background: rgba(168,90,60,.18); color: #E9B79F; border: 1px solid rgba(168,90,60,.5); }

.booking-success { display: none; text-align: center; padding: 12px 0 4px; }
.booking-success.show { display: block; animation: pop .6s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.booking-success .check { width: 66px; height: 66px; margin: 0 auto 18px; border-radius: 50%; background: var(--resin); color: var(--taiga-deep); display: flex; align-items: center; justify-content: center; }
.booking-success .check svg { width: 32px; height: 32px; }
.booking-success p { color: rgba(240,233,217,.75); margin: 10px auto 22px; max-width: 34ch; }
.booking-success .num { font-family: var(--display); font-weight: 600; color: var(--resin); }
.booking-success .remind { display: grid; gap: 8px; justify-items: center; margin: 0 auto 22px; padding: 18px 20px; max-width: 420px; border-radius: var(--r-md);
  background: rgba(206,147,73,.08); border: 1.5px dashed rgba(206,147,73,.6); }
.booking-success .remind[hidden] { display: none; }
.booking-success .remind b { font-family: var(--display); font-weight: 400; font-size: 1.15rem; }
.booking-success .remind span { font-size: 14px; line-height: 1.45; color: rgba(240,233,217,.72); }
.booking-success .remind .btn { margin-top: 4px; }
.booking-success .remind small { font-size: 12.5px; color: rgba(240,233,217,.55); }
.booking-success .remind small b { font-family: var(--body); font-size: inherit; font-weight: 600; color: rgba(240,233,217,.8); }
.booking-success .remind__qr { width: 132px; height: 132px; padding: 8px; border-radius: 10px; background: #fff; }
.booking-success .remind__qr svg { width: 100%; height: 100%; display: block; }
.booking-success .remind__qr[hidden] { display: none; }
.booking-success .remind code { font-size: 13px; letter-spacing: .08em; color: var(--resin-bright); }
.slots-retry { margin-left: 6px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--taiga-deep); background: var(--resin); }

/* Допы в форме записи (стоят до купона: .bk-first ниже донастраивает .bk-addon) */
.bk-addons { display: grid; gap: 8px; max-height: 216px; overflow-y: auto; padding-right: 4px; }
.bk-addon { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1.5px solid var(--pine-line); border-radius: 9px;
  cursor: pointer; transition: border-color .25s; font-size: 14px; }
.bk-addon:hover { border-color: var(--resin); }
.bk-addon input { display: none; }
.bk-addon i { width: 16px; height: 16px; flex-shrink: 0; border: 1.5px solid var(--pine-line); border-radius: 4px; position: relative; transition: .2s; }
.bk-addon input:checked + i { background: var(--resin); border-color: var(--resin); }
.bk-addon input:checked + i::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px;
  border: solid var(--taiga-deep); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.bk-addon span { flex: 1; color: rgba(242,231,212,.85); }
.bk-addon b { font-weight: 600; font-size: 13.5px; color: var(--resin-bright); white-space: nowrap; }
.bk-addons-sum { margin-top: 8px; font-size: 13px; color: rgba(242,231,212,.65); min-height: 1.2em; }

/* Купон «первый визит»: карточка слева и отметка в форме — один переключатель (wireCoupon в booking.js) */
.coupon { display: flex; align-items: stretch; width: 100%; max-width: 470px; margin-top: 30px; text-align: left; color: var(--ink);
  background: rgba(206,147,73,.07); border: 1.5px dashed rgba(206,147,73,.75); border-radius: var(--r-md);
  transition: background .3s, border-color .3s, transform .45s var(--ease); }
.coupon:hover { background: rgba(206,147,73,.13); transform: translateY(-2px); }
.coupon__pct { flex-shrink: 0; display: grid; place-items: center; padding: 0 20px; font-family: var(--display); font-size: clamp(1.7rem, 3vw, 2.1rem);
  color: var(--resin-bright); border-right: 1.5px dashed rgba(206,147,73,.5); }
.coupon__body { display: grid; gap: 5px; padding: 16px 20px 17px; }
.coupon__body b { font-family: var(--display); font-weight: 400; font-size: 1.12rem; }
.coupon__body span { font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.coupon__body em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--resin-bright); }
.coupon.on { background: rgba(206,147,73,.16); border-style: solid; border-color: var(--resin); }
.bk-first-row { margin-bottom: 18px; } /* не .field: там label — это подпись поля, а не строка-галочка */
.bk-first { padding-block: 12px; background: rgba(206,147,73,.06); border-style: dashed; border-color: rgba(206,147,73,.6); }

/* Мастера: карточки с круглым фото (контракт C1: photo/bio из /api/specialists). Настоящие радиокнопки лежат
   прозрачным слоем поверх карточки (стрелки, Tab и подписи для скринридера работают сами), значение дублируется
   в скрытом select#bkMaster, откуда его берут запись и подбор времени. Пока фото грузится или его нет — инициалы. */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; }
/* Отступы между рядами — это margin-bottom карточек, а не gap: блок «о мастере» живёт в той же сетке и, пока закрыт, не должен добавлять лишнее расстояние.
   dense: карточка-сосед выбранного мастера встаёт рядом с ним, а «о мастере» занимает следующую строку целиком. */
.masters { --mava: 48px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 206px), 1fr)); grid-auto-flow: row dense; column-gap: 10px; margin-bottom: -10px; }
.mcard { position: relative; display: block; min-width: 0; margin-bottom: 10px; }
.mcard--any { grid-column: 1 / -1; }
.mcard__in { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.mcard__face { position: relative; display: flex; align-items: center; gap: 12px; height: 100%; padding: 9px 40px 9px 9px; border-radius: 16px;
  border: 1.5px solid var(--pine-line); background: var(--taiga-deep); transition: border-color .25s, background .25s, box-shadow .25s; }
.mcard:hover .mcard__face { border-color: rgba(201,146,74,.6); }
.mcard__in:checked + .mcard__face { border-color: var(--resin); background: rgba(206,147,73,.12); box-shadow: 0 0 0 3px rgba(201,146,74,.16); }
.mcard__in:focus-visible + .mcard__face { outline: 2.5px solid var(--resin); outline-offset: 3px; }
.mcard__ava { position: relative; flex: none; display: grid; place-items: center; width: var(--mava); height: var(--mava); border-radius: 50%; overflow: hidden;
  color: var(--resin-bright); background: linear-gradient(150deg, var(--pine-soft), var(--taiga) 72%); border: 1.5px solid rgba(206,147,73,.42); }
.mcard__ini { font-family: var(--display); font-size: 1.05rem; letter-spacing: .02em; line-height: 1; }
.mcard__ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s var(--ease); }
.mcard__ava.has-photo img { opacity: 1; }
.mcard__ava--any svg { width: 25px; height: 25px; }
.mcard__txt { display: grid; gap: 2px; min-width: 0; }
.mcard__txt b { font-weight: 600; font-size: 15px; line-height: 1.25; color: var(--bone); overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }   /* не «Вознесенск/ая»: слово рвётся только по дефису или по слогам, если иначе не влезает */
.mcard__txt small { font-size: 12.5px; line-height: 1.3; color: rgba(242,231,212,.62); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }   /* длинная роль не растягивает соседей на пять строк */
.mcard__tick { position: absolute; top: 50%; right: 13px; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; border: 1.5px solid var(--pine-line); transition: background .25s, border-color .25s; }
.mcard__in:checked + .mcard__face .mcard__tick { background: var(--resin); border-color: var(--resin); }
.mcard__in:checked + .mcard__face .mcard__tick::after { content: ""; position: absolute; left: 6px; top: 2.5px; width: 4px; height: 8px;
  border: solid var(--taiga-deep); border-width: 0 2px 2px 0; transform: rotate(45deg); }
/* Телефон: мастера в две колонки и компактнее (семь карточек в один столбец занимали больше половины экрана и уводили дату,
   время и телефон далеко вниз, хотя выбор мастера необязателен). «Любой свободный» остаётся на всю ширину; отметка выбора
   — галочка на углу карточки, чтобы не отнимать место у имени. */
@media (max-width: 560px) {
  .masters { --mava: 40px; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; }
  .mcard { margin-bottom: 8px; }
  .masters { margin-bottom: -8px; }
  .masters .mbio.is-open { margin-bottom: 8px; }
  .mcard__face { gap: 9px; padding: 8px 9px 8px 8px; border-radius: 14px; }
  .mcard__ini { font-size: .95rem; }
  .mcard__ava--any svg { width: 22px; height: 22px; }
  .mcard__txt b { font-size: 14px; line-height: 1.2; }
  .mcard__txt small { font-size: 12px; line-height: 1.25; }
  .mcard__tick { top: -6px; right: -6px; margin: 0; width: 18px; height: 18px; opacity: 0; background: var(--resin); border-color: var(--resin); }
  .mcard__in:checked + .mcard__face .mcard__tick { opacity: 1; }
  .mcard__in:checked + .mcard__face .mcard__tick::after { left: 5.5px; top: 2px; }
}
/* «О мастере»: раскрывается плавно прямо под карточкой выбранного мастера (booking.js переставляет блок), высота не прыгает рывком */
.mbio { grid-column: 1 / -1; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease), margin-bottom .35s var(--ease); }
.mbio.is-open { grid-template-rows: 1fr; margin-bottom: 10px; }
.mbio__in { min-height: 0; overflow: hidden; visibility: hidden; transition: visibility 0s linear .35s; }
.mbio.is-open .mbio__in { visibility: visible; transition-delay: 0s; }
.mbio__txt { margin: 0; padding: 12px 15px; border-radius: var(--r-sm); border: 1px dashed rgba(206,147,73,.45); background: rgba(206,147,73,.06);
  font-family: var(--serif-i); font-style: italic; font-size: 16.5px; line-height: 1.5; color: rgba(242,231,212,.86); white-space: pre-line; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .mbio, .mbio__in, .mcard__face, .mcard__ava img { transition: none; } }
/* пока ни одной карточки нет (список ещё грузится), блок не нужен */
.masters:empty { margin: 0; }

/* Плашка cookie закреплена внизу и на телефоне закрывала кнопку «Записаться» и поле даты: пока она на экране, у страницы есть нижний отступ
   на её высоту (booking.js выставляет body.has-cookie и --cookie-h), так что всё нужное прокручивается выше плашки */
@media (max-width: 700px) { body.has-cookie { padding-bottom: calc(var(--cookie-h, 0px) + 28px); } }
@media (max-width: 560px) {   /* и плашка на телефоне компактнее: ниже ростом, меньше закрывает */
  body .cookie { gap: 10px; padding: 8px 8px 8px 14px; font-size: 12.5px; line-height: 1.35; }
  body .cookie button { padding: 10px 16px; font-size: 13px; }
}

/* Нет связи с движком (на /zapis и на главной): вместо формы — как записаться иначе */
.bk-down { text-align: center; padding: 8px 0 2px; }
.bk-down[hidden] { display: none; }
.bk-down h3 { margin-bottom: 10px; }
.bk-down p { margin: 0 auto 22px; max-width: 36ch; color: rgba(240,233,217,.75); font-size: 15.5px; }
.bk-down .btn { width: 100%; margin-top: 10px; }

/* телефон: поля «дата» и «имя» друг под другом */
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
}
