:root {
  --bg: #f4f1ea;
  --card: #ffffff;
  --ink: #1d2720;
  --muted: #69736b;
  --line: #e2ddd2;
  --accent: #2f5d3a;
  --accent-ink: #ffffff;
  --accent-soft: #e2ece3;
  --range: #cfe0d1;
  --busy: #ece7de;
  --weekend: #a0671b;
  --danger: #b3261e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 39, 32, .06), 0 6px 20px rgba(29, 39, 32, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141814; --card: #1d231e; --ink: #eef2ec; --muted: #9aa69c; --line: #2e372f;
    --accent: #8fc59b; --accent-ink: #10150f; --accent-soft: #243326; --range: #2c4230; --busy: #262b26;
    --weekend: #e0a656; --danger: #ff8a80; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* иначе display:flex у панели перекрывает атрибут hidden */
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.page { max-width: 760px; margin: 0 auto; padding: 20px 16px 120px; }
.hero { padding: 12px 4px 8px; }
.eyebrow { margin: 0; color: var(--accent); font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
h1 { margin: 4px 0 6px; font-size: clamp(26px, 6vw, 36px); line-height: 1.15; }
.hero-meta { margin: 0; color: var(--muted); }
h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 19px; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 14px; }
.block { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; margin: 14px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
button { font: inherit; color: inherit; }

.cabins { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cabin { text-align: left; border: 1.5px solid var(--line); background: transparent; border-radius: 12px; padding: 14px; cursor: pointer; display: grid; gap: 4px; }
.cabin[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.cabin-title { font-weight: 650; font-size: 17px; }
.cabin-sub, .cabin-meta { color: var(--muted); font-size: 14px; }
.cabin-price { font-weight: 600; margin-top: 4px; }

.hint { margin: -4px 0 10px; color: var(--muted); min-height: 1.45em; }
.hint strong { color: var(--ink); }
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 22px; line-height: 1; cursor: pointer; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; text-decoration: underline; }
.calendars { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .calendars { grid-template-columns: 1fr 1fr; } }
.month-title { text-align: center; font-weight: 600; margin: 0 0 8px; text-transform: capitalize; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.wd { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0 4px; }
.day { position: relative; aspect-ratio: 1 / 1.05; min-height: 44px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; display: grid; place-content: center; gap: 0; padding: 0; }
.day .n { font-size: 15px; font-weight: 550; }
.day .p { font-size: 10.5px; color: var(--muted); }
.day.weekend .p { color: var(--weekend); font-weight: 600; }
.day.free:hover { outline: 1.5px solid var(--accent); }
.day.past, .day.closed, .day.blank { cursor: default; color: var(--muted); opacity: .45; }
.day.busy { background: var(--busy); color: var(--muted); cursor: default; }
.day.busy .n { text-decoration: line-through; }
.day.busy.checkout-ok { cursor: pointer; }
.day.too-short { opacity: .55; }
.day.beyond { opacity: .35; }
.day.in-range { background: var(--range); border-radius: 0; }
.day.start, .day.end { background: var(--accent); color: var(--accent-ink); border-radius: 9px; }
.day.start .p, .day.end .p { color: var(--accent-ink); }
.day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.sw-free { border: 1.5px solid var(--accent); }
.sw-busy { background: var(--busy); border: 1px solid var(--line); }
.sw-weekend { background: var(--weekend); }
.rules { margin: 10px 0 0; padding-left: 18px; font-size: 14px; color: var(--muted); }
.rules:empty { display: none; }

.guests { display: grid; gap: 10px; }
.stepper { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stepper .label small { display: block; color: var(--muted); font-size: 13px; }
.stepper .ctrl { display: flex; align-items: center; gap: 12px; }
.stepper .ctrl button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 20px; cursor: pointer; }
.stepper .ctrl button:disabled { opacity: .35; cursor: default; }
.stepper output { min-width: 20px; text-align: center; font-weight: 600; }

.extras { display: grid; gap: 12px; }
.extra-price { color: var(--muted); font-size: 14px; }

.price .total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 22px; font-weight: 700; }
.price .total small { font-size: 14px; color: var(--muted); font-weight: 500; }
.price details { margin-top: 10px; }
.price summary { cursor: pointer; color: var(--accent); }
.lines { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: 15px; }
.lines li { display: flex; justify-content: space-between; gap: 12px; }
.lines li span:first-child { color: var(--muted); }
.lines .sum { border-top: 1px dashed var(--line); padding-top: 6px; font-weight: 600; }
.lines .sum span:first-child { color: var(--ink); }
.why { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.prepay { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 15px; }
.errors { margin: 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }

.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field span { font-size: 14px; font-weight: 600; }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
.field input, .field textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.field.invalid input { border-color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 4px 0 12px; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.form-errors { color: var(--danger); margin: 0 0 10px; font-size: 14px; }
.form-errors:empty { display: none; }
.primary { width: 100%; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 650; font-size: 17px; padding: 14px 16px; cursor: pointer; }
.primary:disabled { opacity: .45; cursor: default; }
.secondary { display: block; text-align: center; border: 1.5px solid var(--accent); color: var(--accent); border-radius: 12px; padding: 12px 16px; font-weight: 600; text-decoration: none; }

.bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 -6px 20px rgba(0, 0, 0, .06); }
.bar strong { font-size: 19px; display: block; }
.bar span { color: var(--muted); font-size: 13px; }
.bar .primary { width: auto; padding: 12px 18px; font-size: 16px; }
@media (min-width: 900px) { .bar { display: none !important; } }

.done-card { text-align: center; }
.done-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; margin: 6px auto 10px; font-size: 34px; }
.done-icon.test { background: var(--weekend); }
.stay-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; text-align: left; }
.stay-dates div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.stay-dates small { color: var(--muted); display: block; }
.stay-dates b { font-size: 17px; }
.actions { display: grid; gap: 10px; margin-top: 14px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }

/* Текст согласия филиала: гость может раскрыть его прямо в форме */
.agreement { margin: -4px 0 10px 30px; font-size: 13px; color: var(--muted); }
.agreement summary { cursor: pointer; color: var(--accent); }
.agreement div { margin-top: 6px; max-height: 240px; overflow-y: auto; white-space: pre-wrap; line-height: 1.45; }
