/*
  Shared design system for the checkout flow (index.html) and the
  post-purchase Body Comp booking page (body-comp.html). Deliberately
  plain vanilla CSS, no framework — this is a small static app served
  straight off FastAPI's /static mount, not a React/Tailwind build.

  Visual direction: clean, black-and-white, editorial-mobile-app feel
  (Cody's reference: a restaurant-reservation wireframe set — generous
  whitespace, bordered pill fields, solid black pill CTAs, quiet gray
  secondary text, no color beyond black/white/gray).
*/

:root {
  --ink: #111214;
  --muted: #6b6b70;
  --faint: #9a9aa0;
  --border: #e4e4e7;
  --field-bg: #f6f6f7;
  --surface: #ffffff;
  --page-bg: #efeff1;
  --danger: #c0392b;
  --gold: #fec73e; /* Allegiate brand gold — same token as the live join funnel's --yellow-cta */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(17, 18, 20, 0.04), 0 1px 1px rgba(17, 18, 20, 0.03);
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

main {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  padding: 24px 20px 28px;
  position: relative;
}

/* --- Top bar / progress (index.html) --- */
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.back-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--field-bg); border: none; border-radius: var(--radius-pill);
  color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.back-btn:hover { background: var(--border); }
.back-btn:active { transform: scale(0.92); }
.back-btn:disabled { visibility: hidden; }

.progress { flex: 1; display: flex; gap: 5px; }
.progress span { flex: 1; height: 4px; background: var(--border); border-radius: var(--radius-pill); }
.progress span.done { background: var(--ink); }

/* --- Screens --- */
.screen { display: none; flex-direction: column; flex: 1; animation: screen-in 0.28s ease; }
.screen.active { display: flex; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
}

h1 { font-size: 25px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 6px; line-height: 1.2; }
.hint { color: var(--muted); font-size: 14.5px; line-height: 1.5; margin: 0 0 24px; }

/* Secondary heading + tiny helper caption -- used on the location screen
   between the body copy and the option list. */
.subhead { font-size: 18px; font-weight: 600; letter-spacing: -0.005em; margin: 0 0 4px; line-height: 1.3; }
.microcopy { color: var(--faint); font-size: 12.5px; margin: 0 0 16px; }

/* --- Option cards (location / pricing) --- */
.option-list { display: flex; flex-direction: column; gap: 10px; }
.option-btn {
  text-align: left; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); box-shadow: var(--shadow-card);
  cursor: pointer; font-size: 16px; font-weight: 500; color: var(--ink); width: 100%;
  font-family: inherit;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.option-btn:hover { border-color: var(--faint); }
.option-btn:active { transform: scale(0.99); }
.option-btn .price { float: right; color: var(--ink); font-weight: 600; }
.option-btn .sub, .time-btn .sub { display: block; color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 2px; }

/* --- Form fields --- */
.field {
  width: 100%; padding: 14px 16px; margin-bottom: 12px; font-size: 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--field-bg); color: var(--ink); font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.field::placeholder { color: var(--faint); }
.field:focus {
  outline: none; border-color: var(--ink); background: var(--surface);
}
.row { display: flex; gap: 10px; }
.row > .field { flex: 1; min-width: 0; }

.error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 0 0 8px; font-weight: 500; }
.spacer { flex: 1; }

/* --- Primary CTA --- */
.cta {
  display: block; width: 100%; padding: 16px; background: var(--ink); color: #fff;
  border: none; border-radius: var(--radius-pill); font-size: 16px; font-weight: 600;
  font-family: inherit; cursor: pointer; margin-top: 16px; text-align: center;
  transition: transform 0.1s ease, opacity 0.15s ease;
}
.cta:hover { opacity: 0.92; }
.cta:active { transform: scale(0.98); }
.cta:disabled { opacity: 0.45; cursor: default; transform: none; }

/* Plain text, deliberately not a card/bubble — just a quiet reminder of
   what was picked, per Cody (the earlier bordered/shadowed card version
   read as a second button competing with the actual CTA below it). */
.summary {
  padding: 0; margin: 0 0 20px; font-size: 15px; color: var(--muted); font-weight: 500;
}

.contract-widget { display: none; }
.contract-widget.active { display: block; }

/*
  The Buy Now link is rendered by Mindbody's own healcode.js, not markup
  we control — it comes out as a bare text link by default (confusing
  sitting right under the "Finish with Mindbody" paragraph, per Cody).
  Styled here as a bold gold pill so it reads as the obvious next action.
  !important is deliberate: overriding a third-party widget's own inline
  styling, which we can't edit directly.
*/
#contractWidget a {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  background: var(--gold) !important;
  color: var(--ink) !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  font-family: inherit !important;
  padding: 16px !important;
  border-radius: var(--radius-pill) !important;
  text-decoration: none !important;
  text-align: center !important;
  margin-top: 8px !important;
  transition: opacity 0.15s ease;
}
#contractWidget a:hover { opacity: 0.9; }
#contractWidget a:active { transform: scale(0.98); }

/* --- Confirmation --- */
.confirm-icon {
  width: 56px; height: 56px; margin: 32px auto 16px; display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: #fff; border-radius: 50%; font-size: 24px;
}
.confirm-title { text-align: center; font-size: 22px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.01em; }
.confirm-hint { text-align: center; color: var(--muted); font-size: 15px; line-height: 1.5; margin: 0 0 8px; }

/* --- body-comp.html: welcome screen --- */
.welcome-icon { font-size: 46px; text-align: center; margin: 44px 0 14px; }
.welcome-title { text-align: center; font-size: 27px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 10px; }
.welcome-hint { text-align: left; color: var(--muted); font-size: 15px; line-height: 1.55; margin-bottom: 28px; }

/* --- body-comp.html: schedule picker --- */
.day-group { margin-bottom: 20px; }
.day-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); font-weight: 600; margin-bottom: 10px; }
.time-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.time-btn {
  padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink);
  font-family: inherit; text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.time-btn:hover { border-color: var(--faint); }
.time-btn:active { transform: scale(0.96); background: var(--field-bg); }

.confetti { position: fixed; top: -10px; width: 8px; height: 14px; opacity: 0.9; z-index: 5; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(360deg); opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
}
