/* =============================================================================
   app.css — After Dark theme (v04)
   Off-white + near-black + one sharp deep purple. No gold, no meander, no
   italic serif. Geist sans does everything; Geist Mono for the technical bits.
   Drop-in over existing markup: every legacy class still resolves.
   ============================================================================= */

:root {
  /* Core palette */
  --paper:    #fafaf7;          /* true off-white, slightly warm */
  --paperDp:  #ececea;          /* soft section divider */
  --cardBg:   #ffffff;          /* raised */
  --ink:      #0a0a0d;          /* cool near-black */
  --inkSoft:  #2a2a32;
  --mu:       #6a6a76;
  --mu2:      #aeaeb8;
  --line:     rgba(10,10,13,0.08);
  --lineHard: rgba(10,10,13,0.18);

  /* Sole accent — sharp deep purple */
  --purple:   #3a1bb1;
  --purpleSoft: rgba(58,27,177,0.08);
  --purpleDk: #1c0d5e;
  --purpleDp: #120840;

  --ok:       #1d7f3e;
  --er:       #b3261e;
  --warn:     #6a6a76;   /* warn folds into mu */

  /* Legacy aliases — old class names + inline styles still resolve */
  --blue: var(--purple);
  --bd:   var(--purpleDk);
  --bdp:  var(--ink);          /* deepest dark is now ink, not navy */
  --w:    var(--cardBg);
  --cr:   var(--paperDp);
  --bo:   var(--line);
  --tx:   var(--ink);
  --gold: var(--purple);       /* gold→purple anywhere it leaked through */
  --goldHi:#7c5af7;            /* slightly lighter for "highlight" needs */
  --goldShd: var(--purpleDk);

  --tab-h: 76px;
  --top-h: 56px;

  /* Type — Geist does everything */
  --serif: 'Geist', 'Inter', system-ui, sans-serif;       /* legacy alias kept */
  --sans:  'Geist', 'Inter', system-ui, -apple-system, sans-serif;
  --mono:  'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
}

/* ── Reset / base ──────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* min-height (not height) so the document can grow past the viewport and
   the page scrolls. With height:100% + overflow-x:hidden, the body becomes
   a 100vh scroll container and content beyond the viewport gets clipped
   below the fixed tabnav on desktop — which is what caused users to have
   to zoom out to see the bottom of book/index pages. */
html, body { min-height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: clip;
  /* Extra 3rem so the last card/button sits well above the fixed tabnav.
     Per-page overrides (index.html, account.html) can add more if needed. */
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 3rem);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ── Legacy ornament — hidden in v4 (kept as classes for backward compat) ─ */
.meander, .meander-on-dark, .wave-line,
.hero-sun, .auth-top-sun, .stop-sun { display: none; }

/* ── Top bar ───────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink);
  height: var(--top-h);
  padding: 0 1rem;
  padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; justify-content: space-between;
  color: var(--paper);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.topbar-title {
  font-family: var(--sans);
  font-size: 0.78rem; letter-spacing: 0.32em; font-weight: 600;
  text-transform: uppercase;
}
.topbar-actions { display: flex; align-items: center; gap: 0.6rem; }
.lang-btn {
  width: 32px; height: 22px;
  border-radius: 0;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  transition: transform 0.15s, border-color 0.15s;
}
.lang-btn:active { transform: scale(0.92); }
.lang-btn svg { width: 100%; height: 100%; display: block; }

/* ── Page container ────────────────────────────────────────────────────── */
.screen { padding: 1.2rem; max-width: 720px; margin: 0 auto; }
.screen-pad-bottom { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 3rem); }

.h1 {
  font-family: var(--sans);
  font-size: 2.8rem; font-weight: 300; line-height: 0.94;
  letter-spacing: -0.022em;
  margin-bottom: 0.3rem;
}
.h2 {
  font-family: var(--sans);
  font-size: 1.6rem; font-weight: 400; letter-spacing: -0.014em;
}
.h1 em, .h2 em { font-style: normal; color: var(--purple); }

.section-label, .eyebrow {
  font-family: var(--mono);
  font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--mu);
  margin-bottom: 0.45rem;
  display: block;
}
.muted { color: var(--mu); font-size: 0.85rem; }
.mono { font-family: var(--mono); }

/* bilingual-en was a permanent "other-language" subtitle that always showed
   text mismatched with the active language. Hidden so the UI is one language
   at a time. Markup left in HTML for backward compat. */
.bilingual-en { display: none !important; }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--cardBg);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 1rem 1.1rem;
  margin-bottom: 0.7rem;
}
.card-action { cursor: pointer; transition: border-color 0.15s, transform 0.1s, background 0.15s; }
.card-action:active { transform: scale(0.99); }
.card-action:hover { border-color: var(--purple); }
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; }
.card-title {
  font-family: var(--sans); font-weight: 500; font-size: 1.1rem;
  letter-spacing: -0.012em; line-height: 1.15;
}
.card-sub { color: var(--mu); font-size: 0.82rem; margin-top: 0.2rem; }
.card-price {
  font-family: var(--mono); font-weight: 500;
  font-size: 1rem; color: var(--ink); letter-spacing: 0.02em;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--ink); color: var(--paper);
  border: none;
  border-radius: 0;
  padding: 0.95rem 1.2rem;
  font-family: var(--sans); font-size: 0.98rem; font-weight: 500;
  letter-spacing: -0.005em;
  min-height: 50px;
  transition: transform 0.1s, background 0.15s, color 0.15s;
  width: 100%;
}
.btn:active { transform: translateY(1px); }
.btn:hover:not([disabled]) { background: var(--purpleDk); }
.btn[disabled] { opacity: 0.42; cursor: not-allowed; }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--lineHard);
}
.btn-ghost:hover:not([disabled]) { border-color: var(--ink); background: var(--paperDp); }
.btn-sm {
  padding: 0.5rem 0.9rem; font-size: 0.88rem; min-height: 38px; width: auto;
  font-weight: 500;
}
.btn-danger { background: transparent; color: var(--er); border: 1px solid rgba(179,38,30,0.35); }
.btn-danger:hover:not([disabled]) { background: rgba(179,38,30,0.06); }

.btn-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 2px;
  background: none; cursor: pointer;
}
.btn-link.btn-link-gold { color: var(--purple); border-bottom-color: var(--purple); }
.btn-link.btn-link-danger { color: var(--er); border-bottom-color: var(--er); }

/* ── Form ──────────────────────────────────────────────────────────────── */
.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--mu); margin-bottom: 0.4rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--lineHard);
  border-radius: 0;
  padding: 0.55rem 0;
  color: var(--ink);
  outline: none;
  font-family: var(--mono);
  font-size: 1rem;
  transition: border-color 0.15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--mu2); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-bottom-color: var(--ink);
}
.field textarea {
  resize: vertical; min-height: 80px;
  font-family: var(--sans); font-size: 0.95rem;
  border: 1px solid var(--lineHard); padding: 0.7rem 0.85rem;
}

/* ── Banner / alerts ───────────────────────────────────────────────────── */
.banner {
  padding: 0.8rem 1rem;
  border-radius: 0;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  display: flex; align-items: flex-start; gap: 0.6rem;
  border: 1px solid var(--line);
  background: var(--cardBg);
}
.banner-ok   { background: rgba(29,127,62,0.06); color: var(--ok); border-color: rgba(29,127,62,0.28); }
.banner-err  { background: rgba(179,38,30,0.06); color: var(--er); border-color: rgba(179,38,30,0.3); }
.banner-info { background: var(--purpleSoft);     color: var(--purple); border-color: rgba(58,27,177,0.25); }
.banner-warn { background: var(--paperDp);        color: var(--mu); border-color: var(--line); }

/* ── Bottom tab nav ────────────────────────────────────────────────────── */
.tabnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: var(--paper);
  border-top: 1px solid var(--line);
  display: flex;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: var(--mu);
  padding: 0.5rem 0;
  position: relative;
}
.tab svg { width: 22px; height: 22px; stroke-width: 1.4; }
.tab span:not(.tab-dot) {
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  margin-top: 1px;
  font-weight: 500;
}
.tab.on { color: var(--ink); }
.tab.on svg { stroke: var(--ink); }
.tab.on .tab-dot { opacity: 1; transform: scale(1); }
.tab-dot {
  width: 16px; height: 1.5px; border-radius: 0;
  background: var(--purple);
  opacity: 0; transform: scale(0);
  transition: all 0.2s;
  position: absolute; top: 5px;
}
.tab-icon-wrap { position: relative; }

/* ── Floating cart pill ────────────────────────────────────────────────── */
.cart-fab {
  position: fixed;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px);
  left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  border: none;
  border-radius: 0;
  padding: 0.8rem 1.4rem;
  display: none;
  align-items: center; gap: 0.6rem;
  box-shadow: 0 6px 24px rgba(10,10,13,0.3);
  z-index: 55;
  font-family: var(--sans); font-size: 0.95rem; font-weight: 500; letter-spacing: -0.005em;
  transition: transform 0.15s;
}
.cart-fab:active { transform: translateX(-50%) translateY(1px); }
.cart-fab.on { display: inline-flex; }
.cart-badge {
  background: var(--purple); color: var(--paper);
  border-radius: 0;
  min-width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 600; font-size: 0.74rem;
}

/* ── Modal ─────────────────────────────────────────────────────────────── */
.modal-bg {
  position: fixed; inset: 0; background: rgba(10,10,13,0.65);
  z-index: 100;
  display: none; align-items: flex-end; justify-content: center;
  padding: 0;
}
.modal-bg.on { display: flex; }
.modal {
  background: var(--paper);
  width: 100%; max-width: 540px;
  border-top: 2px solid var(--ink);
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.2rem 1.1rem calc(1.6rem + env(safe-area-inset-bottom));
  animation: slide-up 0.22s ease-out;
}
@keyframes slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-grip {
  width: 36px; height: 2px;
  background: var(--ink);
  margin: 0 auto 0.9rem;
}
.modal-title {
  font-family: var(--sans);
  font-size: 1.65rem; font-weight: 400;
  letter-spacing: -0.018em; margin-bottom: 0.7rem;
}

/* ── Spinner ───────────────────────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 1.5px solid var(--line);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 1.4rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Slot grid ─────────────────────────────────────────────────────────── */
.slot-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.35rem;
}
.slot {
  background: var(--cardBg); border: 1px solid var(--line);
  padding: 0.7rem 0.4rem;
  border-radius: 0;
  text-align: center;
  font-family: var(--mono); font-size: 0.95rem; letter-spacing: 0.02em;
  transition: all 0.15s;
  min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.slot.avail { cursor: pointer; color: var(--ink); }
.slot.avail:hover { border-color: var(--ink); }
.slot.on {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.slot.taken {
  color: var(--mu2); background: transparent; cursor: not-allowed;
  border-style: dashed;
  text-decoration: line-through;
}
.slot.waitlist {
  cursor: pointer; color: var(--purple);
  background: transparent;
  border: 1px dashed var(--purple);
  position: relative;
}
.slot.waitlist::after {
  content: ''; position: absolute; top: 4px; right: 4px;
  width: 3px; height: 3px; background: var(--purple);
}
.slot.waitlist.on {
  background: var(--purple); color: var(--paper); border-color: var(--purple);
  border-style: solid;
}

/* ── Step indicator ────────────────────────────────────────────────────── */
.steps {
  display: flex; gap: 0;
  margin-bottom: 1.6rem;
  background: transparent;
  padding: 0;
  border: none;
}
.step {
  flex: 1; text-align: left;
  padding: 0.7rem 0 0.4rem;
  border-top: 2px solid var(--line);
  border-radius: 0;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.18em;
  color: var(--mu); text-transform: uppercase;
  transition: all 0.2s;
}
.step.on {
  border-top-color: var(--ink); color: var(--ink);
  font-family: var(--sans); font-size: 0.86rem; font-weight: 500;
  letter-spacing: -0.005em; text-transform: capitalize;
}
.step.done { border-top-color: var(--purple); color: var(--purple); }

/* ── Hero — flat ink panel, single big action ──────────────────────────── */
.hero {
  background: var(--ink);
  color: var(--paper);
  padding: 2.4rem 1.4rem 2rem;
  margin: -1.2rem -1.2rem 1.4rem;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.hero h1 {
  font-family: var(--sans);
  font-size: 3rem; font-weight: 300; line-height: 0.94; letter-spacing: -0.024em;
  margin-bottom: 0.4rem;
}
.hero h1 em { font-style: normal; color: var(--purple); }
.hero p {
  color: rgba(255,255,255,0.55);
  font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  max-width: 320px; margin: 0.9rem 0 1.4rem;
}
.hero p::before { content: '— '; }

.hero-next {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 1.2rem 0 0;
  margin-top: 1.2rem;
  border-top: 1px solid rgba(255,255,255,0.18);
  color: var(--paper);
  background: transparent;
}
.hero-next .hn-label {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: rgba(255,255,255,0.55);
}
.hero-next .hn-when {
  font-family: var(--mono); font-weight: 500; font-size: 1.8rem;
  margin-top: 6px; line-height: 1; letter-spacing: -0.01em;
}
.hero-next .hn-when em { font-style: normal; color: #7c5af7; }
.hero-next .hn-meta {
  font-family: var(--mono); font-size: 0.66rem; color: rgba(255,255,255,0.55);
  margin-top: 6px; letter-spacing: 0.12em;
}
.hero-next .hn-arrow {
  width: 44px; height: 44px;
  border: 1px solid rgba(255,255,255,0.4); color: var(--paper);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: transparent;
}

/* ── Auth screens ──────────────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--ink);
}
.auth-top {
  padding: 2.5rem 1.5rem 2rem;
  text-align: left;
  color: var(--paper);
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.auth-top h1 {
  font-family: var(--sans);
  font-size: 2.6rem; font-weight: 300; line-height: 0.94; letter-spacing: -0.022em;
  margin-bottom: 0.4rem;
}
.auth-top h1 em { font-style: normal; color: #7c5af7; }
.auth-top p {
  color: rgba(255,255,255,0.55);
  font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  margin-top: 0.6rem;
}
.auth-top p::before { content: '— '; }

.auth-card {
  flex: 1;
  background: var(--paper);
  padding: 2rem 1.4rem 2rem;
}
.auth-tabs { display: flex; margin-bottom: 1.6rem; gap: 1.4rem; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.auth-tab {
  padding: 0 0 10px;
  margin-bottom: -11px;
  font-family: var(--sans); font-size: 1rem; font-weight: 500;
  color: var(--mu); transition: all 0.15s;
  border-bottom: 2px solid transparent;
  background: transparent;
  letter-spacing: -0.005em;
}
.auth-tab.on { color: var(--ink); border-bottom-color: var(--ink); }

.divider {
  display: flex; align-items: center; gap: 0.8rem; margin: 1.4rem 0;
  color: var(--mu);
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.btn-google {
  background: var(--cardBg); color: var(--ink);
  border: 1px solid var(--lineHard);
  font-family: var(--sans); font-size: 0.92rem; font-weight: 500;
  letter-spacing: -0.005em;
}
.btn-google:hover:not([disabled]) { background: var(--paperDp); border-color: var(--ink); }

@media (min-width: 600px) {
  .auth-wrap { width: 100%; max-width: 440px; margin: 0 auto; min-height: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.45); }
  body.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #050507; }
}

/* ── Responsive: desktop ───────────────────────────────────────────────── */
@media (min-width: 720px) {
  body { background: var(--paperDp); }
  .screen { padding: 1.6rem; max-width: 560px; background: var(--paper); }
  .hero { margin: -1.6rem -1.6rem 1.4rem; padding: 3rem 2rem 2.5rem; }
  .hero h1 { font-size: 3.4rem; }
  .tabnav { max-width: 560px; left: 50%; transform: translateX(-50%); }
  .cart-fab { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 18px); }
  .modal { max-width: 480px; }
  .topbar { max-width: 560px; margin: 0 auto; position: sticky; }
  /* Pump desktop bottom padding well past the fixed tabnav so the last
     card / button / confirm card on book/index/my-bookings is always fully
     visible and reachable without zooming out. */
  body { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 6rem); }
}

/* =============================================================================
   Book-flow tweaks (added v5)
   - Bilingual subtitle is hidden because it always showed the wrong language.
   - Book screen widens to ~720px on desktop so big stylist cards have room
     without going edge-to-edge.
   ============================================================================= */
@media (min-width: 980px) {
  body .screen.book-wide {
    max-width: 760px;
  }
}
