/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:        #00A99A;
  --accent-light:  #E7F1EE;
  --accent-border: #CFE2DD;
  --accent-hover:  #067A6E;
  --text:          #0E1B19;
  --text-muted:    #586663;
  --text-faint:    #8AA39D;
  --bg:            #FFFFFF;
  --bg-soft:       #F1F7F5;
  --bg-card:       #FFFFFF;
  --border:        #E0ECE9;
  --border-light:  #EEF4F2;
  --success:       #1D9E75;
  --radius:        14px;
  --radius-lg:     18px;
  --radius-pill:   22px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:     0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:     0 16px 48px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Onest', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-soft);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 100px; /* space for total bar */
}

/* ── NAV ──────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  padding: 0 24px;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}

.nav-logo {
  font-weight: 700; font-size: 17px; color: var(--accent);
  text-decoration: none; letter-spacing: -.3px;
}

.nav-links { display: flex; align-items: center; gap: 20px; }

.nav-link {
  color: var(--text-muted); font-size: 14px; text-decoration: none;
  font-weight: 500; transition: color .15s;
}
.nav-link:hover { color: var(--text); }

.nav-phone {
  color: var(--accent); font-size: 14px; text-decoration: none;
  font-weight: 600; transition: opacity .15s;
}
.nav-phone:hover { opacity: .8; }

/* ── HERO ─────────────────────────────────────────────────── */
.page-hero {
  background: var(--accent);
  padding: 48px 24px 40px;
  text-align: center;
}

.hero-content { max-width: 560px; margin: 0 auto; }

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
  font-size: 12px; font-weight: 600; letter-spacing: .8px;
  text-transform: uppercase;
  padding: 4px 12px; border-radius: 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,.2);
}

.hero-title {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800; color: #fff;
  letter-spacing: -.5px; line-height: 1.15;
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 16px; color: rgba(255,255,255,.72);
  line-height: 1.6;
}

/* ── MAIN ─────────────────────────────────────────────────── */
.main { max-width: 800px; margin: 0 auto; padding: 32px 20px; }

/* ── STEP SECTION ─────────────────────────────────────────── */
.step-section { margin-bottom: 32px; }

.step-label {
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

.step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.var-note {
  font-size: 12px; color: var(--text-faint);
  margin-bottom: 16px;
}

/* ── SIZE GRID ────────────────────────────────────────────── */
.size-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.size-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 16px 8px;
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); cursor: pointer;
  transition: all .18s; text-align: center;
}
.size-btn:hover { border-color: var(--accent-border); background: var(--accent-light); }
.size-btn.active {
  border-color: var(--accent); background: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(67,56,202,.12);
}

.size-icon { font-size: 28px; line-height: 1; }
.size-name { font-size: 14px; font-weight: 600; color: var(--text); }
.size-sub  { font-size: 11px; color: var(--text-muted); line-height: 1.3; }

/* ── CATEGORY ACCORDION ───────────────────────────────────── */
.cat-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer; user-select: none;
  transition: background .15s;
}
.cat-header:hover { background: var(--bg-soft); }

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

.cat-icon { font-size: 16px; color: var(--accent); }

.cat-title { font-size: 15px; font-weight: 600; color: var(--text); }

.cat-note {
  font-size: 12px; color: var(--text-muted);
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 20px;
}

.cat-chevron {
  font-size: 18px; color: var(--text-muted);
  transition: transform .2s;
  flex-shrink: 0;
}

.cat-body {
  display: none; padding: 0 16px 16px;
  border-top: 1px solid var(--border-light);
}
.cat-body.open { display: block; }

.single-note {
  font-size: 11px; color: var(--text-faint); margin-top: 10px;
}

/* ── SERVICE GRID ─────────────────────────────────────────── */
.svc-grid {
  display: flex; flex-direction: column; gap: 6px;
  padding-top: 12px;
}

.svc-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-soft); border: 1.5px solid var(--border);
  border-radius: var(--radius); cursor: pointer; text-align: left;
  transition: all .15s; width: 100%;
}
.svc-card:hover { border-color: var(--accent-border); background: var(--accent-light); }
.svc-card.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.svc-check {
  width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--border); background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: transparent; flex-shrink: 0;
  transition: all .15s;
}
.svc-card.selected .svc-check {
  background: var(--accent); border-color: var(--accent);
  color: #fff;
}

.svc-info { flex: 1; min-width: 0; }
.svc-name { font-size: 14px; font-weight: 500; color: var(--text); }
.svc-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.svc-price {
  font-size: 14px; font-weight: 700; color: var(--accent);
  white-space: nowrap; flex-shrink: 0;
}
.svc-card.selected .svc-price { color: var(--accent-hover); }

/* ── TOTAL BAR ────────────────────────────────────────────── */
.total-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.32,.72,0,1);
  box-shadow: 0 -4px 24px rgba(0,0,0,.08);
}
.total-bar.visible { transform: translateY(0); }

.total-bar-inner {
  max-width: 800px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.total-info { flex: 1; }
.total-count { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.total-amount { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -.5px; }

.total-cta {
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-pill);
  padding: 13px 30px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all .15s; white-space: nowrap;
  font-family: inherit;
}
.total-cta:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.total-cta:disabled { opacity: .45; cursor: default; }

/* ── ORDER MODAL ──────────────────────────────────────────── */
.order-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(17,17,16,.6);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;   /* окно не липнет к краям экрана */
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.order-overlay.open { opacity: 1; pointer-events: all; }

.order-modal {
  background: var(--bg); border-radius: var(--radius-lg);
  width: 100%; max-width: 640px;
  max-height: calc(100vh - 48px); overflow-y: auto;
  padding: 28px 24px 32px;
  position: relative;
  transform: translateY(40px);
  transition: transform .25s cubic-bezier(.32,.72,0,1);
  box-shadow: var(--shadow-lg);
}
.order-overlay.open .order-modal { transform: translateY(0); }

.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-soft); border: 1px solid var(--border);
  font-size: 14px; color: var(--text-muted);
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--border); color: var(--text); }

.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; letter-spacing: -.3px; }

.order-receipt {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px;
  max-height: 180px; overflow-y: auto;
}
.order-receipt pre {
  font-family: 'Onest', sans-serif; font-size: 13px; line-height: 1.6;
  color: var(--text-muted); white-space: pre-wrap;
}

/* ── FORM ─────────────────────────────────────────────────── */
.order-form { display: flex; flex-direction: column; gap: 14px; }

.form-row { display: flex; flex-direction: column; gap: 5px; }
/* display:flex перебивает [hidden] браузера — иначе скрытая строка видна */
.form-row[hidden] { display: none; }
.form-row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex-direction: unset; }
.car-sel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
select.form-input { cursor: pointer; appearance: auto; }
select.form-input:disabled { opacity: .55; cursor: default; }

.form-label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.opt { font-weight: 400; color: var(--text-faint); }

.form-input {
  padding: 11px 14px; font-size: 15px;
  background: var(--bg-soft); border: 1.5px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: inherit; outline: none; transition: border-color .15s;
  width: 100%;
}
.form-input:focus { border-color: var(--accent); background: #fff; }
/* Незаполненное поле: без этой подсветки форма молча ничего не делала */
.form-input-err, .form-input-err:focus { border-color: #DC2626; background: #FEF6F6; }
.form-err { font-size: 13px; color: #DC2626; margin-top: 2px; }
.form-textarea { resize: vertical; min-height: 72px; }

.form-submit {
  margin-top: 4px; padding: 14px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-pill);
  font-size: 16px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.form-submit:hover:not(:disabled) { background: var(--accent-hover); }
.form-submit:disabled { opacity: .5; cursor: default; }

.form-legal { font-size: 11px; color: var(--text-faint); line-height: 1.5; text-align: center; }
.req { color: var(--accent); }

/* ── SLOT PICKER ──────────────────────────────────────────── */
.manual-slots { display: flex; flex-wrap: wrap; gap: 8px; min-height: 36px; }
.mslots-hint  { font-size: 13px; color: var(--text-faint); padding: 6px 0; }
.mslots-error { color: var(--red, #EF4444); }

.mslot {
  padding: 8px 14px; border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--bg); font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: inherit; transition: all .15s;
  color: var(--text);
}
.mslot.available:hover { border-color: var(--accent); color: var(--accent); }
.mslot.selected       { background: var(--accent); border-color: var(--accent); color: #fff; }
.mslot.booked, .mslot.past {
  opacity: .35; cursor: not-allowed; text-decoration: line-through;
}

@keyframes mslots-shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-6px); }
  40%,80% { transform: translateX(6px); }
}
.mslots-shake { animation: mslots-shake .4s ease; }

/* ── СБП ОПЛАТА ───────────────────────────────────────────── */
.order-pay { text-align: center; padding: 8px 0; }
.pay-amount { font-size: 26px; font-weight: 800; margin-bottom: 14px; }
.pay-qr { display: flex; justify-content: center; margin-bottom: 14px; }
.pay-qr-img { width: 240px; height: 240px; border-radius: 12px; border: 1px solid var(--border); }
.pay-qr-stub {
  width: 240px; height: 240px; border-radius: 12px; border: 2px dashed var(--accent-border);
  display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 14px;
}
.pay-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.pay-status { font-size: 15px; font-weight: 600; color: var(--accent); margin-bottom: 14px; }
.pay-cancel {
  background: none; border: none; color: var(--text-muted); font-size: 14px; cursor: pointer;
  text-decoration: underline; margin-top: 8px;
}

/* ── SUCCESS ──────────────────────────────────────────────── */
.order-success { text-align: center; padding: 24px 0; }

.success-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: #ECFDF5; color: var(--success);
  font-size: 24px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  border: 2px solid #A7F3D0;
}

.success-title { font-size: 22px; font-weight: 700; margin-bottom: 10px; }

.success-text { font-size: 15px; color: var(--text-muted); line-height: 1.6; max-width: 360px; margin: 0 auto 24px; }

.success-back {
  display: inline-block;
  background: var(--accent); color: #fff;
  text-decoration: none; border-radius: var(--radius);
  padding: 12px 28px; font-weight: 600; font-size: 15px;
  transition: background .15s;
}
.success-back:hover { background: var(--accent-hover); }

/* ── MOBILE ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .size-grid { grid-template-columns: repeat(2, 1fr); }

  .page-hero { padding: 32px 20px 28px; }

  .cat-header { padding: 14px 16px; }
  .cat-note { display: none; }

  .svc-card { padding: 10px 12px; }
  .svc-name { font-size: 13px; }
  .svc-price { font-size: 13px; }

  .total-bar-inner { gap: 12px; }
  .total-amount { font-size: 20px; }
  .total-cta { padding: 11px 20px; font-size: 14px; }

  .order-modal { padding: 24px 16px 28px; }
}

/* ── Поиск авто с автоподбором (марка+модель, кириллица → латиница) ── */
.car-search-wrap { position: relative; }
.car-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  background: #fff; border: 1px solid #D7E0DE; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(14,27,25,.14); overflow: hidden; max-height: 260px; overflow-y: auto;
}
.car-suggest.car-suggest-up { top: auto; bottom: calc(100% + 4px); }
.car-suggest-item {
  padding: 11px 14px; font-size: 15px; color: #0E1B19; cursor: pointer;
}
.car-suggest-item:hover, .car-suggest-item.active { background: #E8F6F4; }
.car-suggest-item .cs-brand { color: #067A6E; font-weight: 600; }
.car-suggest-empty { padding: 11px 14px; font-size: 13px; color: #8A9A97; }

/* ── «Мы вас узнали»: подсказка по номеру телефона ───────────────── */
/* Показывается, только если номер нашёлся в базе. Госномера и суммы сюда
   не приходят — сервер отдаёт лишь имя, модели машин и процент скидки. */
.kc {
  background: var(--accent-light); border: 1px solid var(--accent-border);
  border-radius: var(--radius); padding: 14px 16px;
}
.kc-hi { font-size: 15px; font-weight: 700; color: var(--text); }
.kc-msg { margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: var(--text-muted); }
.kc-msg b { color: var(--accent-hover); }
.kc-cars { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.kc-car {
  background: #fff; border: 1.5px solid var(--accent-border); border-radius: 999px;
  padding: 9px 15px; min-height: 40px; font-family: inherit; font-size: 14px;
  font-weight: 600; color: var(--text); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.kc-car:hover { border-color: var(--accent); }
.kc-car.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.kc-no {
  margin-top: 12px; background: none; border: none; padding: 0;
  font-family: inherit; font-size: 13px; color: var(--text-faint);
  text-decoration: underline; cursor: pointer;
}
.kc-no:hover { color: var(--text-muted); }

/* ── Шаг 1: телефон ─────────────────────────────────────────────── */
/* Пока номер не введён, остальные поля закрыты: по нему мы узнаём клиента
   и подставляем имя с машиной — заполнять их вручную заранее незачем. */
.form-hint { font-size: 12.5px; line-height: 1.45; color: var(--text-faint); }
.form-row.locked { opacity: .45; pointer-events: none; user-select: none; }
.form-locked-note {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-faint); padding: 2px 0 2px;
}
.form-locked-note::before { content: '🔒'; font-size: 13px; }
.kc-car-new { border-style: dashed; border-color: var(--accent); color: var(--accent-hover); }
.kc-car-new.on { background: var(--accent); border-style: solid; color: #fff; }

/* Поле авто под выбором чипами: читаемое, но не редактируемое */
.form-row.fixed .form-input { background: var(--bg-soft); color: var(--text); cursor: default; }
.form-row.fixed .form-input::placeholder { color: var(--text-faint); }
.kc.err { border-color: #DC2626; }

/* Скидка на экране «Заявка принята» — человек должен увидеть, что обещание сдержано */
.success-disc {
  margin: 12px auto 0; max-width: 30em;
  background: var(--accent-light); border-radius: var(--radius);
  padding: 12px 16px; font-size: 15px; line-height: 1.5; color: var(--accent-hover);
}
.success-disc b { font-weight: 700; }
