/* Машиноместа: клиентское приложение.
   Палитра: бетон (тёплые нейтральные) + один акцент, синий парковочного знака. */

:root {
  --bg: #ebe8e3;
  --surface: #f7f5f1;
  --raised: #ffffff;
  --sunk: #dfdbd3;
  --ink: #24211e;
  --ink-2: #4a4540;
  --muted: #655f57;
  --line: #cdc8be;
  --line-soft: #dcd8cf;

  --accent: #1b4dd6;
  --accent-rgb: 27 77 214;
  --accent-hover: #153cab;
  --accent-soft: #dde5fa;
  --on-accent: #ffffff;

  --danger: #b42318;
  --danger-soft: #fbe4e1;
  --ok: #1d6b42;
  --ok-soft: #dcefe3;
  --warn: #84560a;
  --warn-soft: #f5e7c6;

  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --gutter: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
body.is-loc { overflow: hidden; }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
img { max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.icon { flex: none; }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r-sm);
}
.skip:focus { top: 8px; }
.noscript { padding: 24px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 1.5px solid transparent; border-radius: var(--r);
  font-weight: 600; font-size: 1rem; text-decoration: none; line-height: 1.2;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--raised); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover:not(:disabled) { border-color: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--sunk); }
.btn-block { width: 100%; }
.btn:disabled { background: var(--sunk); color: #8a847b; border-color: transparent; cursor: not-allowed; }
.btn.is-loading:disabled { background: var(--accent); color: var(--on-accent); opacity: .85; cursor: progress; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-2);
}
.icon-btn:hover { background: var(--sunk); }

.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
.spinner-lg { width: 28px; height: 28px; color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Шапка и бренд ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 1.1rem; line-height: 1;
}
.site-bar { max-width: 1200px; margin: 0 auto; padding: 16px var(--gutter); }

/* ---------- Главная ---------- */
.home { max-width: 1200px; margin: 0 auto; padding: 8px var(--gutter) 64px; }
.hero { display: grid; gap: 24px; padding: 16px 0 40px; }
.hero-title {
  font-size: clamp(2.25rem, 1.2rem + 5.2vw, 4.5rem);
  line-height: 1.02; font-weight: 700; letter-spacing: -0.035em;
  max-width: 14ch; text-wrap: balance;
}
.hero-title:focus { outline: none; }
.hero-side { display: grid; gap: 20px; align-content: end; max-width: 460px; }
.hero-lead { font-size: 1.125rem; line-height: 1.55; color: var(--ink-2); max-width: 36ch; }
.steps { display: grid; gap: 0; counter-reset: step; border-top: 1px solid var(--line); }
.steps li {
  counter-increment: step; display: flex; gap: 14px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink-2);
}
.steps li::before { content: counter(step); font-weight: 700; color: var(--accent); min-width: 1ch; }

.section-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 16px; }
.resume { margin-bottom: 40px; }
.resume-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 12px; }
.resume-list { display: grid; gap: 8px; }
.resume-item {
  display: grid; grid-template-columns: 1fr auto auto; gap: 2px 12px; align-items: center;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  text-decoration: none; transition: border-color .15s;
}
.resume-item:hover { border-color: var(--accent); }
.resume-num { font-weight: 700; grid-column: 1; }
.resume-what { color: var(--muted); font-size: .9375rem; grid-column: 1; grid-row: 2; }
.resume-sum { grid-column: 2; grid-row: 1 / span 2; font-weight: 600; }
.resume-item .icon { grid-column: 3; grid-row: 1 / span 2; color: var(--muted); }

.loc-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.loc-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.loc-card.skeleton { min-height: 340px; background: linear-gradient(100deg, var(--surface) 30%, #fff 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.card-media { display: block; aspect-ratio: 16 / 10; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; }
.card-img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; display: block; filter: saturate(.85); transition: transform .5s var(--ease); }
.loc-card:hover .card-img { transform: scale(1.04); }
.card-body { padding: 16px 16px 8px; display: grid; gap: 10px; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--sunk); font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.tag-alt { background: var(--accent-soft); color: var(--accent-hover); }
.card-title { font-size: 1.5rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.deal-rows { display: grid; margin: 4px -16px 0; }
.deal-row {
  display: grid; grid-template-columns: 1fr auto 18px; grid-template-areas: 'name count arrow' 'bar bar bar';
  gap: 8px 12px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line-soft);
  text-decoration: none; transition: background-color .15s;
}
.deal-row:hover { background: var(--accent-soft); }
.deal-name { grid-area: name; font-weight: 600; }
.deal-count { grid-area: count; color: var(--ink-2); font-size: .9375rem; }
.deal-count b { color: var(--accent); font-size: 1.125rem; margin-right: 2px; }
.deal-row.is-empty .deal-count { color: var(--muted); }
.deal-row .icon { grid-area: arrow; color: var(--muted); }
.deal-bar { grid-area: bar; height: 3px; background: var(--sunk); border-radius: 2px; overflow: hidden; }
.deal-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }

/* ---------- Состояния ---------- */
.state { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 48px 20px; grid-column: 1 / -1; }
.state-icon { color: var(--danger); }
.state-title { font-size: 1.25rem; font-weight: 700; }
.state-text { color: var(--ink-2); max-width: 44ch; }
.state-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.state .btn { margin-top: 6px; }

/* ---------- Переключатель ---------- */
.seg { display: inline-flex; padding: 3px; background: var(--sunk); border-radius: var(--r); gap: 2px; }
.seg-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg-label {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px;
  border-radius: 9px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.seg-label:hover { color: var(--ink); }
.seg-input:checked + .seg-label { background: var(--ink); color: #fff; }
.seg-input:focus-visible + .seg-label { outline: 3px solid var(--accent); outline-offset: 2px; }
.seg-wide { display: flex; }
.seg-wide .seg-label { flex: 1; padding: 0 8px; }

/* ---------- Форма ---------- */
.booking-form { display: grid; gap: 16px; margin-top: 16px; }
.field { display: grid; gap: 6px; }
.field-label { font-weight: 600; font-size: .9375rem; }
.field-opt { font-weight: 400; color: var(--muted); }
.field-hint { font-size: .875rem; color: var(--muted); }
.field-error { font-size: .875rem; color: var(--danger); font-weight: 500; }
.input {
  width: 100%; min-height: 48px; padding: 10px 14px;
  background: var(--raised); border: 1.5px solid var(--line); border-radius: var(--r);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #8b857c; }
.input:hover { border-color: #aaa398; }
.input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .25); }
.textarea { resize: vertical; min-height: 84px; }
.has-error .input, .input[aria-invalid='true'] { border-color: var(--danger); background: #fffafa; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.company-block { display: grid; gap: 16px; }
.check { display: flex; gap: 12px; align-items: flex-start; }
.check-input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); }
.check-label { font-size: .9375rem; color: var(--ink-2); cursor: pointer; }
.field-consent { gap: 6px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
  background: var(--danger-soft); color: var(--danger); border-radius: var(--r); font-weight: 500;
}
.fine { font-size: .875rem; color: var(--muted); line-height: 1.45; }

/* ---------- Экран локации ---------- */
.loc { height: 100dvh; display: flex; flex-direction: column; }
.loc-bar {
  flex: none; display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: 'back head brand' 'deal deal deal';
  gap: 4px 4px; align-items: center; padding: 8px var(--gutter) 10px 4px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 5;
}
.back { grid-area: back; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ink); }
.back:hover { background: var(--sunk); }
.loc-heading { grid-area: head; min-width: 0; }
.loc-title { font-size: 1.25rem; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-title:focus { outline: none; }
.loc-sub { font-size: .875rem; color: var(--muted); }
.loc-brand { grid-area: brand; }
.loc-brand .brand-name { display: none; }
.deal-slot { grid-area: deal; padding-left: 12px; }
.deal-slot .seg { display: flex; }
.deal-slot .seg-label { flex: 1; }
.deal-single { display: inline-block; padding: 6px 14px; border-radius: 99px; background: var(--sunk); font-weight: 600; font-size: .9375rem; }

/* Панель: шторка на мобильном, колонка справа на десктопе */
.panel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; max-height: 76%; overflow: auto;
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: 0 -10px 40px rgb(36 33 30 / .22);
  transform: translateY(105%); visibility: hidden;
  transition: transform .32s var(--ease), visibility 0s .32s;
  padding-bottom: env(safe-area-inset-bottom);
}
.panel.open { transform: none; visibility: visible; transition: transform .32s var(--ease), visibility 0s; }
.panel[data-mode='form'] { top: 0; max-height: none; border-radius: 0; }
.panel-head {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  padding: 16px 8px 8px 16px; position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.panel-title { font-size: 1.5rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; }
.panel-title:focus { outline: none; }
.panel-sub { color: var(--muted); font-size: .9375rem; margin-top: 2px; }
.panel-body { padding: 8px 16px 20px; display: grid; gap: 16px; align-content: start; }
.panel-hint { color: var(--ink-2); font-size: .9375rem; }
.panel .state { padding: 16px 0; justify-items: start; text-align: left; }

.chip { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .8125rem; font-weight: 700; }
.chip-free { background: var(--accent-soft); color: var(--accent-hover); }
.chip-reserved { background: var(--warn-soft); color: var(--warn); }
.chip-sold, .chip-rented, .chip-unavailable { background: var(--sunk); color: var(--ink-2); }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
.facts > div { background: var(--raised); padding: 12px 14px; }
.facts dt { font-size: .8125rem; color: var(--muted); }
.facts dd { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; margin-top: 2px; }
.spot-note { font-size: .9375rem; color: var(--ink-2); }
.months { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.months legend { font-weight: 600; font-size: .9375rem; padding: 0; margin-bottom: 8px; }
.total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.total-label { color: var(--ink-2); }
.total-sum { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; }
.total-note { color: var(--muted); }

.link-back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 4px 0; color: var(--accent); font-weight: 600; }
.link-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.summary { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; background: var(--raised); border: 1px solid var(--line-soft); border-radius: var(--r); }
.summary-main { font-weight: 700; }
.summary-sub { font-size: .875rem; color: var(--muted); }
.summary-sum { font-size: 1.25rem; white-space: nowrap; }
.panel .booking-form { margin-top: 0; }

/* ---------- Экран счёта ---------- */
.bk { max-width: 600px; margin: 0 auto; padding: 8px var(--gutter) 64px; }
.bk-content { display: grid; gap: 20px; }
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); position: relative; }
.ticket-top { padding: 24px 20px 20px; display: grid; gap: 8px; justify-items: start; }
.bk-title { font-size: clamp(1.75rem, 1.2rem + 2.5vw, 2.5rem); line-height: 1.08; font-weight: 700; letter-spacing: -0.03em; }
.bk-title:focus { outline: none; }
.bk-number { font-size: 1.125rem; color: var(--ink-2); }
.bk-number span { color: var(--muted); }
.chip-bk-wait { background: var(--warn-soft); color: var(--warn); }
.chip-bk-ok { background: var(--ok-soft); color: var(--ok); }
.chip-bk-off { background: var(--sunk); color: var(--ink-2); }
.ticket-tear { position: relative; height: 0; border-top: 2px dashed var(--line); margin: 0 14px; }
.ticket-tear::before, .ticket-tear::after {
  content: ''; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line);
}
.ticket-tear::before { left: -26px; clip-path: inset(-2px -2px -2px 50%); }
.ticket-tear::after { right: -26px; clip-path: inset(-2px 50% -2px -2px); }
.ticket-body { padding: 22px 20px 24px; display: grid; gap: 20px; }
.bk-facts { display: grid; gap: 14px; }
.bk-facts dt { color: var(--muted); font-size: .875rem; }
.bk-facts dd { font-weight: 600; font-size: 1.0625rem; }
.bk-sum dd { font-size: 2.25rem; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; color: var(--ink); }
.tick-wrap { color: var(--muted); font-weight: 400; }
.bk-note { color: var(--ink-2); }
.qr-box { display: grid; justify-items: center; gap: 10px; padding: 16px; background: var(--raised); border: 1px solid var(--line-soft); border-radius: var(--r); }
.qr-frame { width: min(240px, 100%); aspect-ratio: 1; background: #fff; padding: 8px; }
.qr { display: block; width: 100%; height: 100%; }
.qr-cap { font-size: .9375rem; color: var(--ink-2); }
.how-title { font-size: 1.0625rem; font-weight: 700; margin-bottom: 8px; }
.how ol { display: grid; gap: 8px; counter-reset: how; }
.how li { counter-increment: how; display: grid; grid-template-columns: 22px 1fr; gap: 8px; color: var(--ink-2); }
.how li::before { content: counter(how); font-weight: 700; color: var(--accent); }
.bk-share { display: grid; gap: 12px; justify-items: start; color: var(--ink-2); font-size: .9375rem; }
.bk-refresh { color: var(--muted); font-size: .875rem; }
.bk-more { justify-self: start; }

/* ---------- Уведомления ---------- */
.toasts { position: fixed; z-index: 50; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast {
  padding: 12px 16px; background: var(--ink); color: #fff; border-radius: var(--r); font-weight: 500; box-shadow: 0 8px 24px rgb(0 0 0 / .25);
  animation: toast-in .25s var(--ease);
}
.toast-error { background: var(--danger); }
.toast-ok { background: var(--ok); }
.toast.out { opacity: 0; transition: opacity .25s; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Десктоп ---------- */
@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .loc-brand .brand-name { display: inline; }
}

@media (min-width: 900px) {
  :root { --gutter: 40px; }
  .site-bar { padding-top: 24px; padding-bottom: 24px; }
  .hero { grid-template-columns: 1.4fr 1fr; align-items: end; padding: 24px 0 64px; gap: 48px; }

  .loc-bar {
    grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: 'back head deal brand';
    gap: 8px 20px; padding: 10px var(--gutter) 10px 12px;
  }
  .loc-title { font-size: 1.5rem; }
  .deal-slot { padding-left: 0; }
  .deal-slot .seg { display: inline-flex; }
  .deal-slot .seg-label { flex: none; padding: 0 22px; }

  .panel {
    position: static; flex: none; width: 400px; max-height: none; height: 100%;
    border-radius: 0; box-shadow: none; border-left: 1px solid var(--line);
    transform: none; visibility: visible; transition: none; padding-bottom: 0;
  }
  .panel[data-mode='form'] { top: auto; }
  .panel-head { padding: 20px 12px 8px 24px; }
  .panel-body { padding: 8px 24px 28px; }
  .bk { padding-top: 24px; }
  .ticket-top { padding: 32px 32px 24px; }
  .ticket-body { padding: 28px 32px 32px; }
}

@media (min-width: 1200px) {
  .panel { width: 440px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .spinner { animation-duration: 1.4s !important; animation-iteration-count: infinite !important; }
  .card-img { transition: none !important; }
}

.bk-contact { font-size: .9375rem; color: var(--ink-2); }
.bk-contact a { color: var(--accent); font-weight: 600; }
