@import url('/assets/brand.css');

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --font-body: var(--brand-font-body);
  --font-head: var(--brand-font-heading);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --t-xs: 0.8125rem; --t-sm: 0.875rem; --t-md: 1rem; --t-lg: 1.125rem; --t-xl: 1.375rem; --t-2xl: 1.75rem; --t-3xl: 2.25rem; --t-hero: clamp(2.5rem, 6vw, 4.25rem);
  --radius: 14px; --radius-sm: 10px; --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 8px 24px rgba(0, 0, 0, .06);

  --bg: var(--brand-background);
  --surface: #ffffff;
  --surface-2: color-mix(in srgb, var(--brand-background) 60%, #ffffff);
  --text: var(--brand-text);
  --heading: var(--brand-heading);
  --muted: color-mix(in srgb, var(--brand-text) 75%, var(--brand-background));
  --line: color-mix(in srgb, var(--brand-text) 14%, transparent);
  --accent: var(--brand-primary);
  --accent-ink: color-mix(in srgb, var(--brand-primary) 55%, #000000);
  --accent-soft: color-mix(in srgb, var(--brand-primary) 16%, #ffffff);
  --btn-bg: var(--brand-button-background);
  --btn-text: var(--brand-button-text);
  --btn-bg-hover: color-mix(in srgb, var(--brand-button-background) 85%, #000000);
  --hero-from: var(--brand-text);
  --hero-to: color-mix(in srgb, var(--brand-text) 70%, var(--brand-primary));
  --hero-text: var(--brand-background);
  --warn-bg: #fdf1d6; --warn-text: #6b4400;
  --danger: #b42318; --danger-bg: #fde7e4;
  --focus: color-mix(in srgb, var(--brand-primary) 55%, #000000);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: color-mix(in srgb, var(--brand-text) 55%, #000000);
  --surface: color-mix(in srgb, var(--brand-text) 85%, #000000);
  --surface-2: color-mix(in srgb, var(--brand-text) 75%, #000000);
  --text: var(--brand-background);
  --heading: var(--brand-background);
  --muted: color-mix(in srgb, var(--brand-background) 75%, var(--brand-text));
  --line: color-mix(in srgb, var(--brand-background) 18%, transparent);
  --accent-ink: color-mix(in srgb, var(--brand-primary) 70%, #ffffff);
  --accent-soft: color-mix(in srgb, var(--brand-primary) 22%, var(--surface));
  --hero-from: color-mix(in srgb, var(--brand-text) 60%, #000000);
  --hero-to: color-mix(in srgb, var(--brand-text) 85%, var(--brand-primary));
  --warn-bg: #3d2f0c; --warn-text: #ffe2a3;
  --danger: #ffb4ab; --danger-bg: #4a1a16;
  --focus: var(--brand-primary);
  color-scheme: dark;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: var(--t-md); line-height: 1.55; overflow-x: hidden; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--heading); line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 var(--s3); }
h1 { font-size: var(--t-3xl); } h2 { font-size: var(--t-2xl); } h3 { font-size: var(--t-xl); } h4 { font-size: var(--t-lg); }
p { margin: 0 0 var(--s3); }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--s4); }
.muted { color: var(--muted); }
.small { font-size: var(--t-sm); }
.price, .money { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); color: var(--text); padding: var(--s3); z-index: 100; }
.skip:focus { left: var(--s3); }

/* ── Buttons & controls ─────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 10px 18px; border-radius: var(--radius-pill); border: 2px solid transparent; font: 700 var(--t-md)/1.2 var(--font-head); cursor: pointer; text-decoration: none; background: var(--btn-bg); color: var(--btn-text); transition: background .15s, transform .15s, border-color .15s; }
.btn:hover { background: var(--btn-bg-hover); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-busy="true"] { background: var(--surface-2); color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn.light { background: transparent; color: var(--hero-text); border-color: color-mix(in srgb, var(--hero-text) 60%, transparent); }
.btn.light:hover { background: color-mix(in srgb, var(--hero-text) 12%, transparent); }
.btn.danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.btn.sm { min-height: 44px; padding: 6px 12px; font-size: var(--t-sm); }
.btn.block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--accent); }
label { display: block; font-weight: 600; font-size: var(--t-sm); margin-bottom: var(--s1); }
.field { margin-bottom: var(--s4); }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 30%, transparent); }
.field-error { color: var(--danger); font-size: var(--t-sm); margin-top: var(--s1); min-height: 1em; }
[aria-invalid="true"] { border-color: var(--danger); }
.error-summary { border: 2px solid var(--danger); background: var(--danger-bg); color: var(--danger); padding: var(--s3) var(--s4); border-radius: var(--radius-sm); margin-bottom: var(--s4); }
.error-summary[hidden] { display: none; }
.row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── Cards, chips, notices ──────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin-bottom: var(--s2); }
.cards { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); align-items: stretch; }
.price-card { display: grid; grid-template-rows: auto 1fr auto; gap: var(--s3); height: 100%; }
.price-card .price { font-size: var(--t-2xl); color: var(--heading); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: var(--t-xs); font-weight: 700; background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; }
.chip.warn { background: var(--warn-bg); color: var(--warn-text); }
.chip.danger { background: var(--danger-bg); color: var(--danger); }
.chip.plain { background: var(--surface-2); color: var(--text); }
.notice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--brand-primary) 40%, transparent); margin-bottom: var(--s4); }
.notice.warn { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice .card { height: 100%; transition: border-color .15s, box-shadow .15s; }
.choice input:checked + .card { border: 2px solid var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 25%, transparent); }
.choice input:focus-visible + .card { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice .card:hover { border-color: var(--accent); }

/* ── Public shell ───────────────────────────────────────────────────────── */
.site-nav { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-nav .wrap { display: flex; align-items: center; gap: var(--s4); min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: var(--s2); text-decoration: none; color: var(--heading); font: 800 var(--t-lg)/1 var(--font-head); letter-spacing: -0.02em; white-space: nowrap; }
.brand img { height: 36px; width: auto; }
.nav-links { display: flex; gap: var(--s1); margin-left: auto; align-items: center; }
.nav-links a { color: var(--text); text-decoration: none; font-weight: 600; padding: 10px 12px; border-radius: var(--radius-pill); min-height: 44px; display: inline-flex; align-items: center; }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.nav-actions { display: flex; gap: var(--s2); align-items: center; }
.burger { display: none; }
.nav-links .nav-mobile-only { display: none; }
@media (max-width: 900px) { .nav-links .nav-mobile-only { display: inline-flex; } }
@media (max-width: 480px) {
  .nav-actions .acct-btn { display: none; }
  .brand { font-size: 1rem; gap: 6px; }
  .brand img { height: 30px; }
  .site-nav .wrap { gap: var(--s2); }
}
@media (max-width: 900px) {
  .burger { display: inline-grid; margin-left: auto; }
  .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--line); padding: var(--s3); box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-actions .btn.nav-cta { display: none; }
}
.hero { position: relative; color: var(--hero-text); background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); min-height: min(78vh, 720px); display: grid; }
.hero .hero-inner { align-self: end; padding: var(--s9) 0 var(--s8); }
.hero h1 { color: var(--hero-text); font-size: var(--t-hero); line-height: 1.04; letter-spacing: -0.03em; max-width: 14ch; margin-bottom: var(--s4); }
.hero p.lead { font-size: var(--t-xl); max-width: 46ch; margin-bottom: var(--s5); }
.hero .eyebrow { display: inline-block; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: var(--t-xs); margin-bottom: var(--s4); }
.hero-facts { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); margin-top: var(--s6); font-weight: 600; }
.hero-facts span { display: inline-flex; gap: var(--s2); align-items: center; }
.section { padding: var(--s8) 0; }
.section-head { margin-bottom: var(--s5); max-width: 60ch; }
.section-head p { color: var(--muted); font-size: var(--t-lg); }
.steps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.step { display: flex; flex-direction: column; gap: var(--s3); }
.step .step-n { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--btn-text); font: 800 var(--t-lg) var(--font-head); }
.svc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.svc-list li { display: flex; justify-content: space-between; gap: var(--s3); border-bottom: 1px dashed var(--line); padding-bottom: var(--s2); }
@media (max-width: 860px) { .steps-grid { grid-template-columns: 1fr; } .hero .hero-inner { padding: var(--s8) 0 var(--s7); } }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: var(--s7) 0 var(--s5); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s5); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.trust { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.page { padding: var(--s6) 0 var(--s8); }
.page-head { margin-bottom: var(--s5); }
.page-head p { color: var(--muted); max-width: 64ch; }

/* ── Booking ────────────────────────────────────────────────────────────── */
.book-step { margin-bottom: var(--s6); }
.book-step > h2 { font-size: var(--t-xl); display: flex; align-items: center; gap: var(--s2); }
.date-strip { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: var(--s2); scroll-snap-type: x mandatory; }
.date-strip button { flex: none; scroll-snap-align: start; min-width: 72px; min-height: 64px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; display: grid; place-items: center; line-height: 1.2; padding: 6px; }
.date-strip button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--s2); }
.slots button { min-height: 44px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: 600 var(--t-sm) var(--font-body); cursor: pointer; font-variant-numeric: tabular-nums; }
.slots button:hover:not([disabled]) { border-color: var(--accent); }
.slots button[aria-pressed="true"] { background: var(--accent); color: var(--btn-text); border-color: var(--accent); }
.slots button[disabled] { text-decoration: line-through; color: var(--muted); background: var(--surface-2); cursor: not-allowed; }
.summary-bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: var(--s3) 0; z-index: 20; }
.summary-bar .wrap { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.session-card { display: grid; grid-template-columns: 1fr auto; gap: var(--s3); align-items: start; }
.session-card .meta { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); color: var(--muted); font-size: var(--t-sm); }
@media (max-width: 600px) { .session-card { grid-template-columns: 1fr; } }
.list { display: grid; gap: var(--s3); }

/* ── Shop ───────────────────────────────────────────────────────────────── */
.shop-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s5); align-items: start; }
.basket { position: sticky; top: 88px; }
.basket-line { display: grid; grid-template-columns: 1fr auto; gap: var(--s2); padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.qty { display: inline-flex; align-items: center; gap: var(--s1); }
.qty button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font-weight: 700; }
@media (max-width: 900px) { .shop-layout { grid-template-columns: 1fr; } .basket { position: static; } }
.product-card { display: grid; grid-template-rows: auto auto 1fr auto; gap: var(--s2); height: 100%; }
.product-card .row { justify-content: space-between; }

/* ── Dialog, toast, states ──────────────────────────────────────────────── */
dialog { border: none; border-radius: var(--radius); padding: 0; width: min(560px, calc(100vw - 24px)); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(10, 20, 35, .55); }
.dialog-body { padding: var(--s5); max-height: 80vh; overflow-y: auto; }
.dialog-actions { display: flex; gap: var(--s2); justify-content: flex-end; flex-wrap: wrap; margin-top: var(--s4); }
.toasts { position: fixed; bottom: var(--s4); right: var(--s4); left: var(--s4); display: grid; justify-items: end; gap: var(--s2); z-index: 200; pointer-events: none; }
.toast { pointer-events: auto; max-width: 420px; background: var(--brand-text); color: var(--brand-background); padding: var(--s3) var(--s4); border-radius: var(--radius-sm); box-shadow: var(--shadow); display: flex; gap: var(--s2); align-items: center; }
.toast.error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.skeleton { display: grid; gap: var(--s3); }
.skeleton span { display: block; height: 18px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton span { animation: none; } * { transition: none !important; } }
.state { text-align: center; padding: var(--s6) var(--s4); }
.state p { color: var(--muted); }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-tools { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--s3); }
.table-tools input { max-width: 280px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); max-height: 70vh; }
table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { position: sticky; top: 0; background: var(--surface-2); color: var(--heading); font-weight: 700; z-index: 1; white-space: nowrap; }
th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; min-height: 32px; }
th button:focus-visible { outline: 3px solid var(--focus); }
tbody tr:hover { background: var(--surface-2); }
.pager { display: flex; gap: var(--s2); align-items: center; justify-content: flex-end; margin-top: var(--s3); }

/* ── Admin shell ────────────────────────────────────────────────────────── */
.admin { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: var(--s4); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { margin-bottom: var(--s5); }
.sidebar .console-tag { display: block; font-size: var(--t-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: -12px 0 var(--s4); }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; gap: var(--s3); align-items: center; min-height: 44px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: 600; }
.side-nav a:hover { background: var(--surface-2); }
.side-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.topbar { display: flex; gap: var(--s3); align-items: center; padding: var(--s3) var(--s5); border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 30; }
.topbar h1 { font-size: var(--t-xl); margin: 0; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .who { margin-left: auto; font-size: var(--t-sm); color: var(--muted); }
.admin-main { padding: var(--s5); min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s4); }
.kpi .v { font: 800 var(--t-2xl) var(--font-head); color: var(--heading); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .l { color: var(--muted); font-size: var(--t-sm); }
.panel { margin-bottom: var(--s5); }
.chart svg { width: 100%; height: auto; }
.chart .bar { fill: var(--accent); }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.tabs { display: flex; gap: var(--s1); flex-wrap: wrap; margin-bottom: var(--s3); }
.tabs button { min-height: 44px; padding: 8px 14px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 var(--t-sm) var(--font-body); cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.admin-burger { display: none; }
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s; z-index: 60; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .admin-burger { display: inline-grid; }
  .admin-main { padding: var(--s4); }
  .topbar { padding: var(--s3); }
  .topbar .who { display: none; }
}
.signin-shell { min-height: 100vh; display: grid; place-items: center; padding: var(--s4); }
.signin-card { width: min(440px, 100%); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.prose p { max-width: 70ch; }
.leader { display: grid; gap: var(--s1); }
.leader .role { color: var(--accent-ink); font-weight: 700; font-size: var(--t-sm); text-transform: uppercase; letter-spacing: .06em; }
