:root {
  --bg: #0e0d0b;
  --surface: #181613;
  --surface-2: #221f1b;
  --surface-3: #2d2924;
  --line: rgba(243, 236, 224, 0.09);
  --line-strong: rgba(243, 236, 224, 0.18);
  --text: #f3ece0;
  --muted: #a8a094;
  --faint: #6f685e;
  --accent: #c9a46a;
  --accent-soft: rgba(201, 164, 106, 0.14);
  --accent-ink: #1b1408;
  --ok: #7cc49a;
  --warn: #e6b45c;
  --danger: #e2806f;
  --radius: 16px;
  --radius-sm: 10px;
  --display: 'Frank Ruhl Libre', 'Times New Roman', serif;
  --body: 'Heebo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 440px; display: flex; align-items: flex-end; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center 30%; filter: grayscale(.25) contrast(1.05); transform: scale(1.04); }
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14,13,11,.35) 0%, rgba(14,13,11,.55) 45%, var(--bg) 100%);
}
.hero-top { position: absolute; top: 0; inset-inline: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; }
.hero-inner { position: relative; z-index: 2; width: 100%; padding-bottom: 28px; }
.logo { width: 76px; height: 76px; border-radius: 50%; background: #fff center/cover; border: 2px solid rgba(255,255,255,.85); box-shadow: 0 8px 30px rgba(0,0,0,.4); margin-bottom: 16px; }
.brand-en { font-family: var(--display); letter-spacing: .32em; font-size: 12px; color: var(--accent); margin-bottom: 4px; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(40px, 11vw, 56px); line-height: 1; letter-spacing: -.01em; }
.hero p.welcome { color: #d9d1c4; margin-top: 10px; max-width: 34ch; font-size: 15px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; background: rgba(24,22,19,.7); border: 1px solid var(--line-strong); font-size: 13px; color: #e8e0d3; backdrop-filter: blur(6px); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(124,196,154,.2); }
.chip .dot.closed { background: var(--danger); box-shadow: 0 0 0 3px rgba(226,128,111,.2); }
.chip .star { color: var(--accent); }

.pill-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 99px; background: rgba(24,22,19,.75); border: 1px solid var(--line-strong); font-size: 14px; font-weight: 500; backdrop-filter: blur(6px); }
.pill-btn svg { width: 17px; height: 17px; }

.actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 20px; }
.action { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted); transition: background .2s, color .2s; }
.action:hover { background: var(--surface-2); color: var(--text); }
.action svg { width: 22px; height: 22px; color: var(--accent); }
.actions.few .action { flex-direction: row; justify-content: center; gap: 10px; padding: 14px; font-size: 15px; color: var(--text); }

/* ---------- Sections ---------- */
section.block { padding: 28px 0 8px; }
.step-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.step-num { font-family: var(--display); color: var(--accent); font-size: 15px; min-width: 22px; }
.step-head h2 { font-family: var(--display); font-weight: 500; font-size: 24px; line-height: 1.2; }
.step-head .sel { margin-inline-start: auto; font-size: 13px; color: var(--accent); }
.step { transition: opacity .3s var(--ease); }
.step.locked { opacity: .35; pointer-events: none; }
.step.locked .step-body { display: none; }

/* services */
.services { display: grid; gap: 8px; }
.svc { display: flex; align-items: center; gap: 14px; width: 100%; text-align: start; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, background .2s, transform .15s; }
.svc:hover { border-color: var(--line-strong); }
.svc:active { transform: scale(.99); }
.svc .info { flex: 1; min-width: 0; }
.svc .name { font-weight: 500; font-size: 16px; }
.svc .dur { color: var(--muted); font-size: 13px; margin-top: 2px; }
.svc .price { font-family: var(--display); font-size: 20px; }
.svc .price small { font-size: 13px; color: var(--muted); margin-inline-start: 1px; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; display: grid; place-items: center; transition: all .2s; }
.check svg { width: 13px; height: 13px; opacity: 0; color: var(--accent-ink); }
[aria-pressed="true"].svc, [aria-pressed="true"].barber { border-color: var(--accent); background: linear-gradient(0deg, var(--accent-soft), var(--accent-soft)), var(--surface); }
[aria-pressed="true"] .check { background: var(--accent); border-color: var(--accent); }
[aria-pressed="true"] .check svg { opacity: 1; }

/* barbers */
.barbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.barber { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-align: center; transition: border-color .2s, background .2s; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--surface-3) center/cover; display: grid; place-items: center; font-family: var(--display); font-size: 22px; color: var(--accent); border: 1px solid var(--line-strong); }
.avatar svg { width: 24px; height: 24px; }
.barber .name { font-weight: 500; font-size: 14px; line-height: 1.25; }
.barber .sub { font-size: 12px; color: var(--muted); }

/* soonest */
.soonest { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; margin-bottom: 14px; padding: 14px 16px; border-radius: var(--radius); border: 1px dashed rgba(201,164,106,.5); background: var(--accent-soft); }
.soonest .bolt { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.soonest .bolt svg { width: 18px; height: 18px; }
.soonest .t1 { font-size: 13px; color: var(--accent); }
.soonest .t2 { font-weight: 500; }
.soonest .go { margin-inline-start: auto; font-size: 14px; font-weight: 500; color: var(--accent); white-space: nowrap; }

/* dates */
.dates { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 16px 8px; margin: 0 -16px; scrollbar-width: none; }
.dates::-webkit-scrollbar { display: none; }
.date { flex: none; scroll-snap-align: start; width: 66px; padding: 10px 0 9px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: center; transition: all .2s; }
.date .dn { font-size: 12px; color: var(--muted); }
.date .dd { font-family: var(--display); font-size: 24px; line-height: 1.15; margin: 2px 0; }
.date .dc { font-size: 11px; color: var(--accent); }
.date[disabled] { opacity: .35; cursor: default; }
.date[disabled] .dc { color: var(--faint); }
.date[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.date[aria-pressed="true"] .dn, .date[aria-pressed="true"] .dc { color: var(--accent-ink); }

/* times */
.time-group { margin-top: 14px; }
.time-group h3 { font-size: 13px; color: var(--muted); font-weight: 400; margin-bottom: 8px; }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.time { height: 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; font-variant-numeric: tabular-nums; transition: all .15s; }
.time:hover { border-color: var(--line-strong); }
.time[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.empty { padding: 24px 16px; text-align: center; color: var(--muted); border-radius: var(--radius); border: 1px dashed var(--line-strong); font-size: 14px; }

/* form */
.form { display: grid; gap: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; height: 50px; padding: 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-strong); outline: none; font-size: 16px; transition: border-color .2s; }
.field textarea { height: 84px; padding: 12px 14px; resize: none; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field input[dir="ltr"] { text-align: right; }
.field .err { color: var(--danger); font-size: 13px; margin-top: 4px; display: none; }
.field.invalid input { border-color: var(--danger); }
.field.invalid .err { display: block; }

.summary { margin-top: 6px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 8px; font-size: 15px; }
.summary .row { display: flex; justify-content: space-between; gap: 12px; }
.summary .row span:first-child { color: var(--muted); }
.summary .total { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; font-weight: 500; }
.summary .total span:last-child { font-family: var(--display); font-size: 20px; color: var(--accent); }
.fineprint { font-size: 12px; color: var(--faint); text-align: center; margin-top: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 22px; border-radius: 14px; font-weight: 700; font-size: 16px; transition: transform .15s, background .2s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #d6b27a; }
.btn-primary[disabled] { opacity: .4; cursor: not-allowed; }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--line-strong); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-block { width: 100%; }
.btn svg { width: 19px; height: 19px; }
.link-btn { color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* sticky bar */
.bar { position: fixed; bottom: 0; inset-inline: 0; z-index: 20; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(14,13,11,.88); backdrop-filter: blur(12px); border-top: 1px solid var(--line); transform: translateY(110%); transition: transform .35s var(--ease); }
.bar.show { transform: none; }
.bar .wrap { display: flex; align-items: center; gap: 14px; padding: 0; }
.bar .sum { flex: 1; min-width: 0; }
.bar .sum b { display: block; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .sum span { font-size: 13px; color: var(--muted); }
.bar .btn { height: 48px; flex: none; }

/* gallery */
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 16px 4px; margin: 0 -16px; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery button { flex: none; width: 46%; max-width: 240px; aspect-ratio: 4/5; border-radius: 14px; overflow: hidden; scroll-snap-align: start; background: var(--surface-2); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.gallery button:hover img { transform: scale(1.04); }

/* info */
.info-card { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.info-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom: 0; }
.info-row svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.info-row .grow { flex: 1; }
.hours { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; padding: 14px 16px; font-size: 14px; }
.hours .today { color: var(--accent); font-weight: 500; }
.hours .v { text-align: end; font-variant-numeric: tabular-nums; color: var(--muted); }
.hours .today.v { color: var(--accent); }

footer { padding: 40px 0 120px; text-align: center; color: var(--faint); font-size: 12px; }
footer a { text-decoration: underline; }

/* sheets / modals */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; z-index: 51; inset-inline: 0; bottom: 0; max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0; border-top: 1px solid var(--line-strong); transform: translateY(105%); transition: transform .4s var(--ease); padding: 10px 0 calc(24px + env(safe-area-inset-bottom)); }
.sheet.open { transform: none; }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 0 auto 14px; }
.sheet h2 { font-family: var(--display); font-weight: 500; font-size: 26px; }
.sheet .close { position: absolute; top: 14px; inset-inline-end: 14px; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; }
.sheet .close svg { width: 18px; height: 18px; }
@media (min-width: 700px) {
  .sheet { inset-inline: 50%; bottom: auto; top: 50%; width: 480px; margin-inline-start: -240px; border-radius: 22px; border: 1px solid var(--line-strong); transform: translateY(-46%); opacity: 0; pointer-events: none; transition: transform .35s var(--ease), opacity .25s; max-height: 86vh; }
  .sheet.open { transform: translateY(-50%); opacity: 1; pointer-events: auto; }
  .sheet .grab { display: none; }
}

.done-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; margin: 8px auto 16px; animation: pop .5s var(--ease); }
.done-icon svg { width: 34px; height: 34px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .45s .25s forwards ease-out; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.center { text-align: center; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 10px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.appt { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 4px; }
.appt .t { display: flex; justify-content: space-between; gap: 10px; font-weight: 500; }
.appt .s { font-size: 14px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.badge.ok { background: rgba(124,196,154,.14); color: var(--ok); }
.badge.warn { background: rgba(230,180,92,.14); color: var(--warn); }
.badge.bad { background: rgba(226,128,111,.14); color: var(--danger); }

.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.94); display: none; align-items: center; justify-content: center; padding: 16px; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 88vh; border-radius: 12px; }
.lightbox .close { position: absolute; top: 16px; inset-inline-end: 16px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.12); display: grid; place-items: center; }
.lightbox .close svg { width: 20px; height: 20px; }

.toast { position: fixed; z-index: 70; bottom: 96px; left: 50%; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: all .3s var(--ease); white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.reveal { animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
