/* =============================================================================
   Booking page — ESTOM Booking Desktop (LSes1)
   Источник: 2.design/landing-page-for-clinic.pen → ESTOM Booking Desktop

   В дизайне 4 шага нарисованы как 4 отдельных фрейма, сложенных вертикально
   (для сравнения состояний). В прототипе мы делаем один интерактивный wizard,
   где одновременно виден только один шаг. Переключает js в <script> внизу
   booking.html.
   ============================================================================= */

/* ---------- Hero with title + stepper ---------- */
.bk-hero {
  padding-top: 24px;
  padding-bottom: 20px;
  background: var(--bg-alt);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.bk-hero__title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.bk-stepper {
  display: flex;
  align-items: center;
  gap: 0;
}
.bk-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 90px;
}
.bk-step__circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid #CBD5E1;
  color: #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}
.bk-step__circle svg {
  width: 16px;
  height: 16px;
}
.bk-step__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}
.bk-step--active .bk-step__circle {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-white);
}
.bk-step--active .bk-step__label {
  color: var(--primary);
  font-weight: 600;
}
.bk-step--done .bk-step__circle {
  background: #16A34A;
  border-color: #16A34A;
  color: var(--text-white);
}
.bk-step--done .bk-step__label {
  color: #16A34A;
  font-weight: 600;
}
.bk-stepper__line {
  width: 50px;
  height: 2px;
  background: #E2E8F0;
  flex-shrink: 0;
}
.bk-stepper__line--active {
  background: var(--primary);
}
.bk-stepper__line--done {
  background: #16A34A;
}

/* ---------- Section body ---------- */
.bk-section {
  padding-top: 24px;
  padding-bottom: 32px;
}
.bk-section__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* ---------- Step 1: service + branch + summary ---------- */
.bk-step1 {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}
.bk-field-label {
  font-size: var(--font-body);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: block;
}
.bk-cats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.bk-cat {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.bk-cat:hover {
  border-color: var(--primary);
}
.bk-cat.is-active {
  background: var(--primary-light);
  border-color: var(--primary);
  border-width: 2px;
  padding: 15px;
}
.bk-cat__icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bk-cat__icon svg {
  width: 100%;
  height: 100%;
}
.bk-cat__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.bk-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.bk-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bk-list__item {
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: var(--font-small);
  color: var(--text-primary);
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bk-list__item:hover {
  border-color: var(--primary);
}
.bk-list__item.is-active {
  background: var(--primary-light);
  border-color: var(--primary);
  border-width: 2px;
  padding: 11px 15px;
  font-weight: 600;
}
.bk-list__item small {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: normal;
}

/* ---------- Summary card (right column step 1) ---------- */
.bk-summary {
  padding: 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  /* Оставляем место под sticky шапкой лендинга (~65px) + небольшой отступ */
  top: 88px;
}
.bk-summary__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.bk-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
}
.bk-summary__lbl {
  color: var(--text-secondary);
  font-weight: 500;
}
.bk-summary__val {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
}
.bk-summary__divider {
  height: 1px;
  background: var(--border);
}
.bk-summary__price {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bk-summary__price-lbl {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}
.bk-summary__price-val {
  font-size: 16px;
  color: var(--primary);
  font-weight: 700;
}

/* ---------- Step 2: calendar + doctors ---------- */
.bk-step2 {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 32px;
  align-items: start;
}
.bk-calendar {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.bk-cal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.bk-cal-head__month {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.bk-cal-nav {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
}
.bk-cal-nav:hover {
  background: var(--bg);
}
.bk-cal-nav svg {
  width: 16px;
  height: 16px;
}
.bk-cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}
.bk-cal-dow span {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 0;
}
.bk-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.bk-cal-day {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
}
.bk-cal-day:hover {
  background: var(--bg);
}
.bk-cal-day--muted {
  color: var(--text-muted);
}
.bk-cal-day--disabled {
  color: #CBD5E1;
  cursor: not-allowed;
}
.bk-cal-day.is-active {
  background: var(--primary);
  color: var(--text-white);
  font-weight: 700;
}

.bk-doctors {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bk-doctors__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.bk-doctor {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.bk-doctor:hover {
  border-color: var(--primary);
}
.bk-doctor.is-active {
  border-color: var(--primary);
  border-width: 2px;
  padding: 15px;
}
.bk-doctor__head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bk-doctor__avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}
.bk-doctor__info {
  flex: 1;
  min-width: 0;
}
.bk-doctor__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.bk-doctor__role {
  font-size: 12px;
  color: var(--text-secondary);
}
.bk-doctor__times {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bk-time {
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.bk-time:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}
.bk-time.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-white);
}

/* ---------- Step 3: form ---------- */
.bk-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}
.bk-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.bk-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bk-form__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.bk-form__input,
.bk-form__textarea {
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bk-form__textarea {
  resize: vertical;
  min-height: 80px;
}
.bk-form__input:focus,
.bk-form__textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.bk-form__consent {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}
.bk-form__checkbox {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  flex-shrink: 0;
}
.bk-form__checkbox svg {
  width: 14px;
  height: 14px;
}

/* ---------- Step 4: confirmation ---------- */
.bk-confirm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.bk-confirm__icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #DCFCE7;
  color: #16A34A;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bk-confirm__icon svg {
  width: 40px;
  height: 40px;
}
.bk-confirm__title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}
.bk-confirm__desc {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 500px;
}
.bk-confirm__card {
  width: 100%;
  max-width: 500px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}
.bk-confirm__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.bk-confirm__lbl {
  color: var(--text-secondary);
  font-weight: 500;
}
.bk-confirm__val {
  color: var(--text-primary);
  font-weight: 600;
}
.bk-confirm__divider {
  height: 1px;
  background: var(--border);
}
.bk-confirm__actions {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

/* ---------- Navigation buttons (bottom of each step) ---------- */
.bk-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}
.bk-nav-row--end {
  justify-content: flex-end;
}
.bk-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  font-family: inherit;
}
.bk-btn--primary {
  background: var(--primary);
  color: var(--text-white);
}
.bk-btn--primary:hover {
  background: var(--primary-dark);
}
.bk-btn--back {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.bk-btn--back:hover {
  background: var(--bg);
}
.bk-btn svg {
  width: 18px;
  height: 18px;
}

/* ---------- Hide/show steps ---------- */
.bk-step-body {
  display: none;
}
.bk-step-body.is-active {
  display: block;
}

/* ---------- Cards grid (service / branch selection) ---------- */
.bk-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.bk-cards-grid--branches {
  grid-template-columns: repeat(3, 1fr);
}
.bk-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.bk-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.bk-card.is-active {
  background: var(--primary-light);
  border-color: var(--primary);
  border-width: 2px;
  padding: 15px;
}
.bk-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.bk-card.is-active .bk-card__icon {
  background: var(--surface);
}
.bk-card__icon--lg { width: 40px; height: 40px; }
.bk-card__icon svg { width: 20px; height: 20px; }
.bk-card__icon--lg svg { width: 22px; height: 22px; }

.bk-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.bk-card__desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}
.bk-card__price {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}
.bk-card__phone {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ---------- Step 3 layout: calendar + times panel ---------- */
.bk-step3 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.bk-times-panel {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.bk-times-panel__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.bk-times-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.bk-times-grid .bk-time {
  padding: 8px 0;
  text-align: center;
}

/* ---------- Step 4 layout: form + summary ---------- */
.bk-step4 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}
.bk-step4 .bk-form {
  max-width: none;
  width: 100%;
}
.bk-step4 .bk-summary { padding: 20px; }
.bk-form__error {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  color: #B91C1C;
  font-size: 13px;
}

/* ---------- WhatsApp submit button ---------- */
.bk-btn--wa {
  background: #25D366;
}
.bk-btn--wa:hover {
  background: #1DA851;
}
.bk-btn--wa svg { fill: currentColor; }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .bk-hero { padding-top: 20px; padding-bottom: 16px; gap: 12px; }
  .bk-hero__title { font-size: 22px; }
  .bk-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .bk-cards-grid--branches { grid-template-columns: 1fr; }
  .bk-step3 { grid-template-columns: 1fr; gap: 16px; }
  .bk-step4 { grid-template-columns: 1fr; gap: 16px; }
  .bk-form__row { grid-template-columns: 1fr 1fr; }
  .bk-summary { position: static; }
}
@media (max-width: 640px) {
  .bk-hero { padding-top: 16px; padding-bottom: 12px; gap: 12px; }
  .bk-hero__title { font-size: 18px; letter-spacing: 0; }
  .bk-section { padding-top: 20px; padding-bottom: 24px; }
  .bk-section__title { font-size: 16px; margin-bottom: 12px; }

  /* Compact stepper — без scale, чтобы тачи работали корректно */
  .bk-step { width: auto; flex: 1; min-width: 0; gap: 4px; }
  .bk-step__circle { width: 24px; height: 24px; font-size: 12px; }
  .bk-step__label { font-size: 10px; }
  .bk-stepper__line { width: 16px; }

  .bk-cards-grid { grid-template-columns: 1fr; gap: 10px; }
  .bk-card { padding: 12px; gap: 4px; }
  .bk-card.is-active { padding: 11px; }
  .bk-card__title { font-size: 14px; }
  .bk-card__desc { font-size: 12px; }
  .bk-card__price, .bk-card__phone { font-size: 12px; }

  .bk-calendar { padding: 12px; }
  .bk-cal-head__month { font-size: 14px; }
  .bk-cal-day { height: 32px; font-size: 12px; }
  .bk-times-grid { grid-template-columns: repeat(3, 1fr); }
  .bk-times-grid .bk-time { padding: 8px 0; font-size: 12px; }

  .bk-form__row { grid-template-columns: 1fr; gap: 12px; }
  .bk-form { gap: 14px; }
  .bk-form__input, .bk-form__textarea { padding: 10px 12px; font-size: 13px; }
  .bk-summary { padding: 16px; gap: 12px; }

  .bk-nav-row { margin-top: 16px; gap: 10px; }
  .bk-btn { padding: 10px 16px; font-size: 13px; gap: 6px; }
  .bk-btn svg { width: 16px; height: 16px; }
}
