/* «Точка» — запись в сервисный центр. Локальная демонстрация. */

:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-soft: #f6f8fc;
  --text: #182234;
  --muted: #667089;
  --line: #dfe5ee;
  --line-strong: #c8d1e0;
  --brand: #2456e6;
  --brand-strong: #1a44bd;
  --brand-soft: #e9efff;
  --brand-ring: rgba(36, 86, 230, 0.25);
  --success: #0f7a52;
  --success-soft: #e2f5ec;
  --danger: #b4232c;
  --danger-soft: #fdecec;
  --warn: #9a6414;
  --warn-soft: #fff6e5;
  --warn-line: #f0d9a6;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 22px 44px -28px rgba(24, 34, 52, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(1100px 460px at 50% -220px, #dde7ff 0%, rgba(238, 241, 246, 0) 72%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.noscript {
  max-width: 640px;
  margin: 40px auto;
  padding: 16px 20px;
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-md);
}

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

/* ---------- Шапка ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  width: 15px;
  height: 15px;
  flex: none;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 5px var(--brand-ring);
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}

.brand-name {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.masthead-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}

/* ---------- Этапы ---------- */

.stepper {
  margin-bottom: 18px;
}

.stepper ol {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stepper li {
  flex: 1 1 0;
  min-width: 0;
}

.stepper-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.stepper-item:disabled {
  cursor: default;
}

.stepper-item.is-current {
  border-color: var(--brand);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 6px 16px -12px rgba(36, 86, 230, 0.75);
}

.stepper-item.is-done {
  border-color: #c9d8c9;
  background: var(--surface);
  color: var(--text);
}

.stepper-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: #e6eaf3;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stepper-item.is-current .stepper-num {
  background: var(--brand);
  color: #fff;
}

.stepper-item.is-done .stepper-num {
  background: var(--success-soft);
  color: var(--success);
}

.stepper-label {
  overflow: hidden;
}

/* ---------- Карточка шага ---------- */

.card {
  background: var(--surface);
  border: 1px solid rgba(223, 229, 238, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(18px, 3vw, 32px);
}

.step-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
}

.step-title {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 27px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.step-title:focus {
  outline: none;
}

.step-lead {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.step-context {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
}

.step-context span {
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Список услуг ---------- */

.option-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 74px;
  padding: 15px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.option:hover {
  border-color: #aebfe8;
  background: #fbfcff;
}

.option.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.option:focus-visible,
.person:focus-visible,
.slot:focus-visible,
.chip:focus-visible,
.btn:focus-visible,
.stepper-item:focus-visible {
  outline: 3px solid var(--brand-ring);
  outline-offset: 2px;
}

.option-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
  min-width: 0;
}

.option-title {
  font-size: 16px;
  font-weight: 650;
}

.option-meta {
  font-size: 13px;
  color: var(--muted);
}

.option-price {
  flex: none;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.option-radio {
  position: relative;
  width: 22px;
  height: 22px;
  flex: none;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  transition: border-color 0.15s ease;
}

.option-radio::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.option.is-selected .option-radio,
.person.is-selected .option-radio {
  border-color: var(--brand);
}

.option.is-selected .option-radio::after,
.person.is-selected .option-radio::after {
  opacity: 1;
  transform: scale(1);
}

/* ---------- Шаг 2 ---------- */

.time-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-top: 22px;
}

.group-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.group-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.people {
  display: grid;
  gap: 10px;
}

.person {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.person:hover {
  border-color: #aebfe8;
  background: #fbfcff;
}

.person.is-selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.person-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: #e3e9f7;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.person-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.person-name {
  font-size: 15px;
  font-weight: 650;
}

.person-role {
  font-size: 12.5px;
  color: var(--muted);
}

.date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.date-input {
  height: 46px;
  padding: 0 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.date-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.chip:hover {
  border-color: var(--brand);
}

.chip.is-selected {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px 9px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.slot:hover:not(:disabled) {
  border-color: var(--brand);
  background: #fbfcff;
}

.slot-time {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.slot-note {
  font-size: 11px;
  color: var(--muted);
}

.slot.is-selected {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.slot.is-selected .slot-note {
  color: rgba(255, 255, 255, 0.85);
}

.slot.is-busy {
  border-color: #e3e8f1;
  background: #f2f4f9;
  color: #9aa5b7;
  cursor: not-allowed;
}

.slot.is-busy .slot-note {
  color: #a7b0c0;
}

.hint-box {
  margin-top: 14px;
  padding: 15px 16px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Пустое расписание ---------- */

.empty {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-md);
  background: var(--warn-soft);
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--warn-line);
  color: var(--warn);
}

.empty-body {
  min-width: 0;
}

.empty-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}

.empty-text {
  margin: 0;
  font-size: 13.5px;
  color: #7c5a1d;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.empty-actions .chip {
  border-color: var(--warn-line);
}

.empty-actions .chip:hover {
  border-color: var(--warn);
}

/* ---------- Действия ---------- */

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.actions .btn-back {
  margin-right: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 24px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-strong);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- Контакты и итог ---------- */

.summary {
  margin: 22px 0 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  overflow: hidden;
}

.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row dt {
  flex: none;
  color: var(--muted);
}

.summary-row dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.summary-row dd.strong {
  color: var(--brand-strong);
  font-size: 16px;
}

.form {
  margin-top: 4px;
}

.field {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 650;
}

.field-label .req {
  color: var(--danger);
}

.field-label .opt {
  color: var(--muted);
  font-weight: 500;
}

.input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.input::placeholder {
  color: #9aa5b7;
}

.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
  background: #fffafa;
}

.input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(180, 35, 44, 0.18);
}

.field-error {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--danger);
}

.alert {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid #f0bfc3;
  border-radius: 12px;
  background: var(--danger-soft);
  color: #7d1d24;
  font-size: 14px;
}

.alert-title {
  margin: 0 0 6px;
  font-weight: 700;
}

.alert-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 3px;
}

/* ---------- Успешная запись ---------- */

.screen-success {
  text-align: center;
}

.success-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  margin: 6px auto 18px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
}

.booking-card {
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  text-align: left;
}

.booking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.booking-id {
  font-family: "DejaVu Sans Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--text);
  text-transform: none;
}

.booking-card .summary {
  margin: 0;
  border: none;
  border-radius: 0;
  background: var(--surface);
}

.booking-note {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.screen-success .actions {
  justify-content: center;
}

/* ---------- Подвал ---------- */

.page-foot {
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

/* ---------- Мобильные ---------- */

@media (max-width: 720px) {
  .time-columns {
    gap: 24px;
  }
}

@media (max-width: 560px) {
  .page {
    padding: 18px 14px 40px;
  }

  .masthead {
    padding-bottom: 16px;
  }

  .masthead-note {
    display: none;
  }

  .stepper ol {
    gap: 6px;
  }

  .stepper-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 9px 10px;
    font-size: 12px;
  }

  .stepper-num {
    width: 23px;
    height: 23px;
    font-size: 12px;
  }

  .stepper-label-extra {
    display: none;
  }

  .card {
    border-radius: 16px;
  }

  .option {
    padding: 13px 14px;
    min-height: 68px;
  }

  .option-title {
    font-size: 15px;
  }

  .slots {
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 8px;
  }

  .actions {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .actions .btn {
    width: 100%;
  }

  .actions .btn-back {
    margin-right: 0;
  }

  .summary-row {
    gap: 12px;
    font-size: 14px;
  }
}

@media (min-width: 721px) {
  .time-columns {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  }
}
