/*
 * Форма записи (templates/_booking_form.php) на токенах site.css.
 * Одна и та же форма стоит на главной (секция «Запись») и на /zapis/.
 */

.booking { --control-h: max(5.6rem, 46px); }
.booking [hidden] { display: none !important; }

.notice {
  padding: 1.4rem 1.8rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.5);
  font-size: var(--fs-small);
}
.notice--error { background: rgba(214, 72, 40, 0.08); color: var(--danger); }
.hint, .placeholder { color: var(--ink-2); font-size: var(--fs-small); }

/* --- Шаги --- */

.step { margin-top: 4.8rem; }
.step:first-child { margin-top: 0; }
.step__title {
  display: flex;
  align-items: baseline;
  gap: 1.6rem;
  margin-bottom: 2rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--hair);
  font-size: var(--fs-h3);
  font-weight: 280;
  letter-spacing: -0.02em;
}
.step__num {
  font-size: var(--fs-micro);
  font-weight: 450;
  letter-spacing: 0.12em;
  color: var(--coral);
  font-variant-numeric: tabular-nums;
}
.step .hint { margin: -0.8rem 0 1.4rem; }

/* --- Формат: компактные строки, на широком экране в две колонки --- */

.products { display: grid; gap: 0.8rem; }
@media (min-width: 768px) { .products { grid-template-columns: 1fr 1fr; } }

.product {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 1.6rem;
  align-items: baseline;
  padding: 1.4rem 1.8rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.32);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  cursor: pointer;
  transition: background-color 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}
.product:hover { background: rgba(255, 255, 255, 0.6); }
.product input { position: absolute; opacity: 0; pointer-events: none; }
.product:has(input:focus-visible) { outline: 2px solid var(--coral); outline-offset: 3px; }
.product:has(input:checked) { background: var(--cream-hi); box-shadow: inset 0 0 0 1.5px var(--coral); }
.product__title { grid-column: 1; grid-row: 1; font-weight: 450; }
.product__price { grid-column: 2; grid-row: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.product__meta { grid-column: 1 / -1; grid-row: 2; color: var(--ink-2); font-size: var(--fs-small); }
.product__about { grid-column: 1 / -1; grid-row: 3; color: var(--ink-3); font-size: var(--fs-micro); line-height: 1.4; }
.product--info { cursor: default; background: transparent; box-shadow: inset 0 0 0 1px var(--hair); }
.product--info:hover { background: transparent; }
.product--info a { color: var(--coral-deep); }

/* --- День и время --- */

.pick { display: grid; gap: 4.8rem 6.4rem; margin-top: 4.8rem; }
.pick > .step { margin-top: 0; }
@media (min-width: 1024px) {
  .pick { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
}

.calendar { display: grid; gap: 2.4rem; max-width: max(46rem, 320px); }
.calendar__month { margin-bottom: 1rem; font-weight: 450; }
.calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.4rem; }
.calendar__wd {
  padding-bottom: 0.6rem;
  text-align: center;
  font-size: var(--fs-micro);
  color: var(--ink-3);
  text-transform: lowercase;
}
.calendar__day {
  position: relative;
  aspect-ratio: 1;
  min-height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.4s var(--ease-out), color 0.4s;
}
.calendar__day:not(:disabled) { font-weight: 500; background: rgba(255, 255, 255, 0.42); }
.calendar__day:hover:not(:disabled) { background: var(--cream-hi); }
.calendar__day:disabled { color: var(--ink-3); opacity: 0.55; cursor: default; }
.calendar__day.is-today::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 14%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--coral);
}
.calendar__day[aria-pressed="true"] { background: var(--ink); color: var(--cream-hi); }

.times { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
.times .placeholder { grid-column: 1 / -1; }
.time {
  min-height: var(--control-h);
  border: 0;
  border-radius: 99rem;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.4s var(--ease-out), color 0.4s;
}
.time:hover { background: var(--cream-hi); }
.time[aria-pressed="true"] { background: var(--ink); box-shadow: none; color: var(--cream-hi); }
.times-day { grid-column: 1 / -1; margin-bottom: 0.4rem; font-weight: 450; }
#times-error { margin-top: 1.2rem; }

/* --- Данные --- */

.fields { display: grid; gap: 2rem; }
@media (min-width: 600px) { .fields { grid-template-columns: 1fr 1fr; gap: 2.4rem 2.4rem; } }

.field { display: grid; gap: 0.8rem; align-content: start; min-width: 0; }
@media (min-width: 600px) { .field--wide { grid-column: 1 / -1; } }
.field label, .field legend { font-size: var(--fs-small); color: var(--ink-2); }
.field__opt { margin-left: 0.4em; color: var(--ink-3); font-size: var(--fs-micro); }
fieldset.field { margin: 0; padding: 0; border: 0; }
.field legend { float: left; width: 100%; margin-bottom: 0.8rem; padding: 0; }
.field textarea {
  width: 100%;
  min-height: 9.6rem;
  padding: 1.4rem 1.8rem;
  border: 0;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  color: var(--ink);
  font: inherit;
  font-size: max(1.6rem, 16px);
  line-height: 1.45;
  resize: vertical;
  transition: box-shadow 0.3s var(--ease-out), background-color 0.3s;
}
.field textarea::placeholder { color: var(--ink-3); }
.field textarea:hover { background: rgba(255, 255, 255, 0.8); }
.field textarea:focus { outline: none; background: var(--cream-hi); box-shadow: inset 0 0 0 1.5px var(--coral); }

/* Мессенджер — таблетки-радио */
.messengers__list { display: flex; flex-wrap: wrap; gap: 0.8rem; clear: both; }
.pill-radio { position: relative; cursor: pointer; color: var(--ink) !important; }
.pill-radio input { position: absolute; opacity: 0; pointer-events: none; }
.pill-radio span {
  display: inline-flex;
  align-items: center;
  min-height: max(4.4rem, 40px);
  padding: 0 2rem;
  border-radius: 99rem;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  font-size: var(--fs-small);
  transition: background-color 0.4s var(--ease-out), color 0.4s;
}
.pill-radio:hover span { background: var(--cream-hi); }
.pill-radio input:focus-visible + span { outline: 2px solid var(--coral); outline-offset: 3px; }
.pill-radio input:checked + span { background: var(--ink); box-shadow: none; color: var(--cream-hi); }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="password"] {
  width: 100%;
  height: var(--control-h);
  padding: 0 1.8rem;
  border: 0;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  color: var(--ink);
  font: inherit;
  font-size: max(1.6rem, 16px); /* не меньше 16px: иначе iOS увеличивает страницу */
  transition: box-shadow 0.3s var(--ease-out), background-color 0.3s;
}
.field input::placeholder { color: var(--ink-3); }
.field input:hover { background: rgba(255, 255, 255, 0.8); }
.field input:focus { outline: none; background: var(--cream-hi); box-shadow: inset 0 0 0 1.5px var(--coral); }
.field input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--danger); }
.field__hint { font-size: var(--fs-micro); color: var(--ink-3); }
.field__error { font-size: var(--fs-small); color: var(--danger); }
.field__error:empty { display: none; }

.field--check { margin-top: 2.4rem; }
.check { display: flex; gap: 1.2rem; align-items: flex-start; font-size: var(--fs-small); color: var(--ink-2) !important; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 0.1em 0 0; accent-color: var(--ink); }
.check a { color: var(--ink); }

.summary {
  display: grid;
  gap: 0.2rem;
  margin-top: 2.4rem;
  padding: 1.8rem 2.2rem;
  border-radius: var(--radius);
  background: var(--cream-hi);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}
.summary strong { font-weight: 450; }
.summary span { color: var(--ink-2); font-size: var(--fs-small); }

#form-error { margin-top: 1.6rem; }
.submit { margin-top: 2.8rem; }
@media (max-width: 599px) { .submit { width: 100%; } }

/* Невидимое поле-ловушка для ботов */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* --- Готово --- */

.done {
  padding: 4rem 3.2rem;
  border-radius: var(--radius);
  background: var(--cream-hi);
}
.done > :first-child { margin-bottom: 1.6rem; font-size: var(--fs-h3); font-weight: 280; }
.done p + p { margin-top: 0.8rem; }
.done:focus { outline: none; }
