/* ================================================================
   app.css: the transactional pages (book, login, account, profile,
   my-booking) in the editorial design system. Loaded after ds.css.

   These pages no longer load style.css / pages.css. Their markup and
   scripts still use the old token names in inline styles (js/booking.js
   summary lines, account.html card templates), so those names are
   bridged to the ds.css palette here instead of being renamed.
   Page-specific layers: css/book.css (booking wizard) and
   css/account.css (account + profile).
================================================================ */

/* ---------- Legacy token bridge ---------- */
:root {
  --navy:         var(--ink);
  --navy-700:     var(--night-2);
  --teal-dark:    var(--teal-ink);
  --teal-dim:     var(--teal-wash);
  --emerald-dark: var(--emerald-ink);
  --emerald-dim:  var(--emerald-wash);
  --zinc-50:  #f8fafb;
  --zinc-100: var(--paper-2);
  --zinc-200: #dbe3e9;
  --zinc-300: #c3cfd9;
  --zinc-400: #98a9bd;
  --zinc-500: #5b6e92;   /* 5:1 on white; the old #8496b4 was 3:1 */
  --zinc-600: #4e6286;
  --zinc-700: var(--ink-2);
  --radius-sm: 0.75rem;
  --radius-md: 1rem;
  --radius-xl: 1.75rem;

  /* Status washes. Amber and rose are states, never brand colours. */
  --amber-wash: #fff6dc;
  --amber-line: #efd186;
  --amber-ink:  #744a00;
  --rose-wash:  #fdeeec;
  --rose-line:  #f1bcb5;
  --rose-ink:   #9f2418;

  --field-radius: 0.9rem;
  --ring: 0 0 0 4px rgba(11, 189, 212, 0.2);
  --lift: 0 18px 40px -24px rgba(13, 33, 69, 0.45);
}

/* The old style.css zeroed every margin and padding. The page CSS was
   written against that, so keep it, at zero specificity: any real rule
   (ds.css or the page layers) still wins. */
:where(.app-page) * { margin: 0; padding: 0; }

/* ---------- Shell ---------- */
.app-shell {
  position: relative;
  padding-block: clamp(1.5rem, 0.9rem + 2.4vw, 3rem) clamp(4.5rem, 3rem + 5vw, 8rem);
}
/* Mono kicker row above the page content: label left, aside right. */
.app-kicker {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-bottom: 1rem; margin-bottom: clamp(1.75rem, 1rem + 2.6vw, 3.25rem);
  border-bottom: 1px solid var(--line);
}
@media (max-width: 560px) { .app-kicker .eyebrow--plain { display: none; } }

/* Display headline used by the app pages (smaller than the marketing .h1). */
.app-title {
  font: 600 clamp(2.4rem, 1.35rem + 4.2vw, 5.25rem)/0.94 var(--font-display);
  letter-spacing: -0.05em;
  color: var(--ink);
  text-wrap: balance;
}
.app-title .serif, .book-h2 .serif, .success-view h2 .serif { color: var(--teal-ink); letter-spacing: -0.02em; padding-right: 0.04em; }
.app-lead {
  margin-top: 1.1rem; max-width: 40ch;
  font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-2);
}
.app-lead a { color: var(--teal-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- Form controls ----------
   One field style for every page. Checkboxes and radios keep their own
   rules (they are toggles, not text fields). */
.app-page :is(.form-block, .auth-field, .profile-edit, .inline-contact) :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select:not(.rec-select)),
.app-page .resched-date {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--field-radius);
  background: var(--white);
  color: var(--ink);
  font: 400 1rem/1.4 var(--font-body);   /* 16px: iOS does not zoom */
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.app-page :is(.form-block, .auth-field, .profile-edit, .inline-contact) textarea { min-height: 0; resize: vertical; line-height: 1.5; }
.app-page :is(.form-block, .auth-field, .profile-edit, .inline-contact) :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select:not(.rec-select)):hover,
.app-page .resched-date:hover { border-color: rgba(13, 33, 69, 0.42); }
.app-page :is(.form-block, .auth-field, .profile-edit, .inline-contact) :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select:not(.rec-select)):focus,
.app-page .resched-date:focus {
  outline: none; border-color: var(--teal); box-shadow: var(--ring);
}
.app-page ::placeholder { color: var(--ink-3); opacity: 1; }

/* Native selects get a drawn chevron. */
.app-page :is(.form-block, .auth-field, .profile-edit, .inline-contact) select,
.app-page .rec-select {
  -webkit-appearance: none; appearance: none;
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230d2145' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

/* Field labels read as the mono micro-label of the design system. */
.app-page :is(.form-block, .auth-field) > label,
.app-page .rec-label,
.app-page .discount-box > label {
  display: block;
  margin-bottom: 0.55rem;
  font: 600 var(--fs-micro)/1.3 var(--font-body);
  color: var(--ink-2);
}
/* Field labels are read, not skimmed: 13px on phones. */
@media (max-width: 640px) {
  .app-page :is(.form-block, .auth-field) > label,
  .app-page .rec-label,
  .app-page .discount-box > label { font-size: 0.8125rem; letter-spacing: 0.1em; }
}

/* ---------- Buttons ----------
   The pill CTA from ds.css (.btn--primary), applied to the class names the
   page scripts already use. A trailing <span aria-hidden="true">→</span>
   becomes the round arrow chip. */
.btn-next, .btn-pay, .auth-submit, .side-cta, .mb-btn {
  --b-bg: var(--teal); --b-fg: var(--night); --b-hover: #2fd0e4; --b-chip: rgba(8, 21, 48, 0.12);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.8rem;
  min-height: 3.4rem; padding: 0.35rem 1.6rem;
  border: 0; border-radius: 999px;
  background: var(--b-bg); color: var(--b-fg);
  font: 600 1rem/1.1 var(--font-display); letter-spacing: -0.01em;
  text-align: center; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: transform 0.5s var(--ease-out), background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.btn-next::before, .btn-pay::before, .auth-submit::before, .side-cta::before, .mb-btn::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--b-hover);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.55s var(--ease-out);
}
.btn-next:hover::before, .btn-pay:hover::before, .auth-submit:hover::before, .side-cta:hover::before, .mb-btn:hover::before {
  transform: scaleX(1); transform-origin: left;
}
.btn-next:active, .btn-pay:active, .auth-submit:active, .side-cta:active, .mb-btn:active { transform: scale(0.98); }
.btn-next:disabled, .btn-pay:disabled, .auth-submit:disabled {
  --b-bg: var(--paper-2); --b-fg: var(--ink-3); --b-chip: rgba(13, 33, 69, 0.06);
  cursor: not-allowed; transform: none;
}
.btn-next:disabled::before, .btn-pay:disabled::before, .auth-submit:disabled::before { display: none; }
.btn-next > span[aria-hidden="true"] {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--b-chip);
  font-size: 1.05rem;
  transition: transform 0.55s var(--ease-out);
}
.btn-next:has(> span[aria-hidden="true"]) { padding-right: 0.4rem; padding-left: 1.5rem; }
.btn-next:not(:disabled):hover > span[aria-hidden="true"] { transform: rotate(-45deg); }

/* Quiet text action ("← Back", "Cancel"). */
.btn-back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 2.75rem; padding: 0 0.25rem;
  font: 500 0.9375rem/1 var(--font-display); color: var(--ink-2);
  background: linear-gradient(currentColor, currentColor) 0.25rem calc(100% - 0.7rem) / 0 1px no-repeat;
  transition: color 0.2s ease, background-size 0.45s var(--ease-out);
}
.btn-back:hover { color: var(--ink); background-size: calc(100% - 0.5rem) 1px; }

/* Small pill used for secondary actions (account cards, profile). */
.pill-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 2.5rem; padding: 0 1.05rem;
  border: 0; border-radius: 999px;
  background: var(--white); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font: 600 0.875rem/1 var(--font-display); letter-spacing: -0.005em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.pill-btn:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.pill-btn.is-primary { background: var(--ink); color: var(--white); box-shadow: none; }
.pill-btn.is-primary:hover { background: var(--teal); color: var(--night); }
.pill-btn.is-danger { color: var(--rose-ink); box-shadow: inset 0 0 0 1px var(--rose-line); }
.pill-btn.is-danger:hover { background: var(--rose-wash); box-shadow: inset 0 0 0 1px var(--rose-ink); }
.pill-btn:disabled { opacity: 0.55; cursor: progress; }

/* WhatsApp actions keep the brand's WhatsApp emerald. */
.side-wa {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 3rem; padding: 0 1.4rem;
  border-radius: 999px;
  background: var(--emerald-ink); color: var(--white);   /* 4.9:1, as .floating-wa */
  font: 600 0.9375rem/1 var(--font-display);
  text-decoration: none;
  box-shadow: 0 14px 30px -18px rgba(18, 129, 61, 0.75);
  transition: background-color 0.25s ease, transform 0.4s var(--ease-out);
}
.side-wa:hover { background: #0e6a32; transform: translateY(-1px); }
.side-wa svg { width: 1.05rem; height: 1.05rem; }

/* ---------- Spinner ---------- */
.spinner {
  width: 16px; height: 16px; flex: none;
  border: 2px solid var(--line-strong);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Floating WhatsApp clears the app's fixed bottom bars ---------- */
@media (max-width: 960px) {
  body.has-mtotal .floating-wa { bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 768px) {
  body.has-bottom-nav .floating-wa { bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }
  /* The shared PWA install prompt (js/pwa-client.js) sits above the account
     bottom tab bar instead of on top of it: nav offset 0.75rem + bar 3.8rem. */
  body.has-bottom-nav .uc-pwa { bottom: calc(4.55rem + env(safe-area-inset-bottom, 0px)); }
}

/* ================================================================
   Login (login.html)
================================================================ */
.auth-grid {
  display: grid; gap: clamp(2rem, 1rem + 3vw, 4rem);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
.auth-intro .eyebrow { margin-bottom: 1.4rem; }
.auth-h1 {
  font: 600 clamp(3rem, 1.6rem + 6vw, 7.5rem)/0.88 var(--font-display);
  letter-spacing: -0.055em; color: var(--ink);
}
.auth-h1::after { content: '.'; color: var(--teal); }
.auth-sub { margin-top: 1.25rem; max-width: 30ch; font-size: var(--fs-lead); line-height: 1.5; color: var(--ink-2); }
.auth-frame { display: none; margin-top: clamp(2rem, 1rem + 2.5vw, 3.5rem); aspect-ratio: 5 / 4; max-width: 34rem; }

.auth-card {
  width: 100%; max-width: 32rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 1rem + 2vw, 2.5rem);
  box-shadow: 0 0 0 1px var(--line), var(--lift);
}
@media (max-width: 899px) {
  .auth-card { max-width: none; }
}
@media (min-width: 900px) {
  .auth-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
  .auth-card { justify-self: end; margin-top: 0.5rem; }
  .auth-frame { display: block; }
}

.google-btn {
  width: 100%; min-height: 3.4rem;
  display: flex; align-items: center; justify-content: center; gap: 0.7rem;
  padding: 0 1.25rem;
  border-radius: 999px;
  background: var(--white); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font: 600 1rem/1 var(--font-display); letter-spacing: -0.01em;
  transition: box-shadow 0.25s ease, background-color 0.25s ease;
}
.google-btn:hover { box-shadow: inset 0 0 0 1px var(--ink); background: var(--paper); }
.google-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.google-btn svg { width: 18px; height: 18px; flex: none; }

.auth-divider {
  display: flex; align-items: center; gap: 0.85rem;
  margin: 1.5rem 0;
  font: 600 var(--fs-micro)/1 var(--font-body);
  color: var(--ink-3);
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem;
  padding: 0.3rem; margin-bottom: 1.5rem;
  border-radius: 999px; background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
}
.auth-tab {
  min-height: 2.6rem; border-radius: 999px;
  font: 600 0.9375rem/1 var(--font-display); color: var(--ink-2);
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.auth-tab:hover { color: var(--ink); }
.auth-tab.is-active { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgba(13, 33, 69, 0.08), 0 0 0 1px var(--line); }

.auth-form { display: none; }
.auth-form.is-active { display: block; animation: appRise 0.45s var(--ease-out); }
.auth-field { margin-bottom: 1.1rem; }
.phone-group { display: grid; grid-template-columns: 7.75rem minmax(0, 1fr); gap: 0.5rem; }
.auth-error {
  display: none;
  margin-bottom: 1.1rem; padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--rose-wash); color: var(--rose-ink);
  box-shadow: inset 0 0 0 1px var(--rose-line);
  font-size: 0.875rem; line-height: 1.45;
}
.auth-error.is-shown { display: block; }
.auth-submit { width: 100%; margin-top: 0.4rem; }
.auth-foot { margin-top: 1.1rem; text-align: center; font-size: 0.875rem; color: var(--ink-2); }
.auth-foot a { color: var(--teal-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

@keyframes appFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* The sign-in form is visible on load: movement only, no fade from opacity 0. */
@keyframes appRise { from { transform: translateY(6px); } to { transform: none; } }

/* ================================================================
   Booking link (my-booking.html, served at /b/<token>)
   A private, single-card page: no site chrome, no analytics.
================================================================ */
.mb-shell { min-height: 100vh; min-height: 100svh; padding: 1.25rem var(--gutter) 3rem; }
.mb-col { max-width: 32rem; margin: 0 auto; }
.mb-logo { display: inline-block; margin: 0.25rem 0 clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.mb-logo img { height: 2.6rem; width: auto; }

.mb-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 1rem + 2vw, 2.25rem);
  box-shadow: 0 0 0 1px var(--line), var(--lift);
}
.mb-hello {
  margin-bottom: 0.9rem;
  font: 600 var(--fs-micro)/1.4 var(--font-body);
  color: var(--ink-2);
}
.mb-h1 {
  font: 600 clamp(2rem, 1.4rem + 2.6vw, 2.75rem)/1 var(--font-display);
  letter-spacing: -0.045em; color: var(--ink);
  text-wrap: balance;
}
.mb-time { margin-top: 0.6rem; font: 600 1.125rem/1.3 var(--font-display); letter-spacing: -0.01em; color: var(--teal-ink); }

.mb-state {
  margin-top: 1.1rem; padding: 0.75rem 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 0.9rem; line-height: 1.5;
}
.mb-state.is-cancelled { background: var(--rose-wash); color: var(--rose-ink); box-shadow: inset 0 0 0 1px var(--rose-line); }

.mb-rows { margin-top: 1.5rem; border-top: 1.5px solid var(--ink); }
.mb-row { display: flex; gap: 1rem; padding: 0.95rem 0; border-bottom: 1px solid var(--line); }
.mb-row dt {
  flex: 0 0 5.75rem; padding-top: 0.2rem;
  font: 600 var(--fs-micro)/1.4 var(--font-body);
  color: var(--ink-3);
}
.mb-row dd { min-width: 0; color: var(--ink); font-size: 0.9375rem; line-height: 1.5; overflow-wrap: anywhere; }
.mb-row dd ul { list-style: none; }
.mb-pay { font: 600 1.0625rem/1 var(--font-display); letter-spacing: -0.01em; }
.mb-ref { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--ink-2); letter-spacing: 0.04em; }

.mb-actions { margin-top: 1.75rem; display: grid; gap: 0.7rem; }
.mb-btn { width: 100%; }
.mb-btn.is-plain { --b-bg: var(--white); --b-fg: var(--ink); --b-hover: var(--paper); box-shadow: inset 0 0 0 1px var(--line-strong); }
.mb-btn.is-wa { --b-bg: var(--emerald-ink); --b-fg: var(--white); --b-hover: #0e6a32; }
.mb-why { margin: 0.1rem 0.25rem; text-align: center; font-size: 0.875rem; line-height: 1.55; color: var(--ink-2); }

.mb-msg { padding: 2rem 0.5rem 0.5rem; text-align: center; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.55; }
.mb-msg strong {
  display: block; margin-bottom: 0.5rem;
  font: 600 1.5rem/1.1 var(--font-display); letter-spacing: -0.03em; color: var(--ink);
}
.mb-foot {
  margin-top: 1.5rem; text-align: center;
  font: 600 var(--fs-micro)/1.4 var(--font-body);
  color: var(--ink-3);
}
.mb-foot a { color: var(--ink-2); }
.mb-foot a:hover { color: var(--ink); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .auth-form.is-active { animation: none; }
}
