/* ============================================================
   FRESH AIR PILATES — Global Stylesheet
   Design: Organic Luxury · Sage & Cream · Cormorant + Jost
   Fonts loaded via <link> in each page's <head> for performance
   ============================================================ */

/* ===== TOKENS ===== */
:root {
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sage:        #7a9e7e;
  --sage-mid:    #5c8260;
  --sage-light:  #b5cbb7;
  --sage-pale:   #e8f0e9;
  --cream:       #faf7f2;
  --warm-white:  #fff9f2;
  --earth:       #8b6f5e;
  --earth-dark:  #5c4639;
  --stone:       #c4b9b0;
  --stone-light: #e8e2de;
  --text-dark:   #2c2420;
  --text-mid:    #5a4f4a;
  --text-light:  #8c827d;
  --gold:        #c9a96e;
  --gold-light:  #e8d5b0;
  --gold-dark:   #b08d3c;
  /* Tokens previously referenced across the codebase but never defined.
     Adding them here so cascading rules don't silently fall back to inherit/initial. */
  --text-muted:  #8c827d;
  --border-light:#e8e2de;
  --bark:        #5c4639;
  --honey:       #c9a96e;
  --sage-dark:   #4a6b4d;
  --cream-dark:  #f0e9dd;
  --radius:      2px;
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --trans:       0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm:   0 2px 12px rgba(44,36,32,0.06);
  --shadow-md:   0 8px 32px rgba(44,36,32,0.10);
  --shadow-lg:   0 20px 60px rgba(44,36,32,0.14);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  font-weight: 300;
  background: var(--cream);
  color: var(--text-dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
ul, ol { list-style: none; }

/* ===== ACCESSIBILITY BASELINE =====
   - Skip-to-content link visually hidden until keyboard focus.
   - :focus-visible ring on every interactive element so keyboard users
     always see where focus is, while mouse users don't get distracted.
   Both added in remediation pass.
*/
.skip-link {
  position: absolute; left: 0; top: 0; transform: translateY(-200%);
  background: var(--text-dark); color: var(--cream);
  padding: 12px 18px; font-family: var(--font-body); font-size: 0.92rem;
  z-index: 9999; border-radius: 0 0 4px 0;
  transition: transform 0.18s var(--ease);
}
.skip-link:focus { transform: translateY(0); outline: 2px solid var(--gold); outline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 2px;
  border-radius: 2px;
}
button:focus-visible, a:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 2px;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.15;
  color: var(--text-dark);
}
h1 { font-size: clamp(2.8rem, 6vw, 5.2rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.4rem, 2.5vw, 2.1rem); }
h4 { font-size: 1.25rem; font-weight: 400; }
h5 { font-size: 1rem; font-weight: 400; }
p  { line-height: 1.78; color: var(--text-mid); font-size: 0.97rem; }
em { font-style: italic; color: var(--sage); }

/* ===== LAYOUT ===== */
.container    { max-width: 1260px; margin: 0 auto; padding: 0 2rem; }
.container-sm { max-width: 820px;  margin: 0 auto; padding: 0 2rem; }
.section      { padding: 3.5rem 0; }
.section-sm   { padding: 2.5rem 0; }

/* ===== BADGE ===== */
.badge {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--sage); margin-bottom: 1.25rem;
}
.badge::before {
  content: ''; display: block; width: 28px; height: 1px;
  background: var(--sage); flex-shrink: 0;
}
.badge.mx-auto::before { display: none; }
.badge-light { color: var(--sage-light); }
.badge-light::before { background: var(--sage-light); }
.badge-gold { color: var(--gold); }
.badge-gold::before { background: var(--gold); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font-body); font-size: 0.76rem;
  font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 0.9rem 2rem; cursor: pointer; border: none;
  transition: all var(--trans); white-space: nowrap;
  border-radius: 100px; line-height: 1;
}
.btn-primary  { background: var(--text-dark); color: var(--cream); }
.btn-primary:hover { background: var(--sage); }
.btn-sage     { background: var(--sage); color: #fff; }
.btn-sage:hover { background: var(--sage-mid); }
.btn-outline  { background: transparent; color: var(--text-dark); border: 1.5px solid var(--text-dark); }
.btn-outline:hover { background: var(--text-dark); color: var(--cream); }
.btn-ghost    { background: transparent; color: var(--sage); border: 1.5px solid var(--sage); }
.btn-ghost:hover { background: var(--sage); color: #fff; }
.btn-gold     { background: var(--gold); color: var(--text-dark); }
.btn-gold:hover { background: var(--earth); color: #fff; }
.btn-light    { background: rgba(255,255,255,0.12); color: #fff; border: 1.5px solid rgba(255,255,255,0.25); }
.btn-light:hover { background: rgba(255,255,255,0.22); }
.btn-full     { width: 100%; }
.btn-lg       { padding: 1.1rem 2.5rem; font-size: 0.82rem; }

/* ===== ANNOUNCEMENT BAR ===== */
.announcement-bar {
  background: var(--sage); color: #fff;
  text-align: center; padding: 0.65rem 1rem;
  font-size: 0.78rem; letter-spacing: 0.04em; font-weight: 400;
  position: relative; z-index: 200;
}
.announcement-bar strong { font-weight: 600; }
.announcement-bar a { text-decoration: underline; color: #fff; }

/* ===== NAVIGATION ===== */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,247,242,0.94);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid rgba(196,185,176,0.25);
  transition: box-shadow var(--trans);
}
.site-nav.scrolled { box-shadow: 0 2px 30px rgba(44,36,32,0.08); }
.nav-inner {
  max-width: 1260px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 70px;
}
.nav-logo { display: flex; align-items: center; cursor: pointer; }
.nav-logo img { height: 42px; width: auto; }
.nav-links {
  display: flex; align-items: center; gap: 0.15rem;
}
.nav-links a {
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-mid);
  padding: 0.5rem 0.8rem; transition: color var(--trans);
  white-space: nowrap; border-radius: 4px;
}
.nav-links a:hover, .nav-links a.active { color: var(--text-dark); }
.nav-links a.active { background: var(--sage-pale); }
.nav-cta {
  margin-left: 0.5rem;
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; background: var(--text-dark); color: var(--cream) !important;
  padding: 0.55rem 1.3rem; border-radius: 100px;
  transition: background var(--trans);
}
.nav-cta:hover { background: var(--sage) !important; }
.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 0.4rem;
}
.nav-hamburger span {
  display: block; width: 22px; height: 1.5px;
  background: var(--text-dark); transition: var(--trans);
  transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  display: none; flex-direction: column;
  position: fixed; inset: 0; z-index: 99;
  background: var(--cream); padding: 90px 2.5rem 2.5rem;
  gap: 0; overflow-y: auto;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: 1.8rem; font-weight: 300; color: var(--text-dark);
  padding: 0.85rem 0; border-bottom: 1px solid var(--stone-light);
  transition: color var(--trans);
}
.mobile-menu a:hover { color: var(--sage); }
.mobile-menu .mobile-cta {
  margin-top: 2rem; background: var(--text-dark); color: var(--cream) !important;
  text-align: center; padding: 1rem; border-radius: 100px;
  font-family: var(--font-body); font-size: 0.82rem;
  font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase;
}
.mobile-menu .mobile-auth-link {
  margin-top: 1rem; background: var(--sage); color: #fff !important;
  text-align: center; padding: 1rem; border-radius: 100px; border-bottom: none;
  font-family: var(--font-body); font-size: 0.82rem;
  font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase;
}

/* ===== PAGE HERO (dark header used across inner pages) ===== */
.page-hero {
  background: var(--text-dark); color: var(--cream);
  padding: 2rem 0 1.5rem; text-align: center;
}
.page-hero h1, .page-hero h2 { color: var(--cream); }
.page-hero p { color: rgba(255,255,255,0.82); max-width: 520px; margin: 0.5rem auto 0; font-size: 0.88rem; }

/* ===== MARQUEE STRIP ===== */
.marquee-strip {
  background: var(--sage); padding: 1.25rem 0;
  overflow: hidden; white-space: nowrap;
}
.marquee-track {
  display: inline-flex; gap: 2.5rem;
  animation: marquee 24s linear infinite;
}
.marquee-track span {
  font-size: 0.68rem; letter-spacing: 0.25em; text-transform: uppercase;
  color: #fff; flex-shrink: 0;
}
.marquee-track .dot { color: rgba(255,255,255,0.4); font-size: 0.6rem; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ===== QUOTE SECTION ===== */
.quote-section {
  background: var(--sage); padding: 3rem 0; text-align: center;
}
.quote-section blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  font-style: italic; font-weight: 300;
  color: #fff; max-width: 720px; margin: 0 auto 0.75rem;
  line-height: 1.5;
}
.quote-section cite {
  font-size: 0.72rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: rgba(255,255,255,0.6);
  font-style: normal; font-family: var(--font-body);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--text-dark); color: var(--cream);
  padding: 2.5rem 0 1.5rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem; margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.footer-brand p  { font-size: 0.82rem; color: rgba(255,255,255,0.78); max-width: 280px; line-height: 1.6; }
.footer-col h5 {
  font-family: var(--font-body);
  font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--sage-light); margin-bottom: 0.8rem; font-weight: 500;
}
.footer-col ul li { margin-bottom: 0.35rem; }
.footer-col ul li a {
  font-size: 0.85rem; color: rgba(255,255,255,0.5);
  transition: color var(--trans);
}
.footer-col ul li a:hover { color: var(--cream); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.75rem;
}
.footer-bottom p { font-size: 0.76rem; color: rgba(255,255,255,0.65); }

/* ===== UTILITY ===== */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.mt-1  { margin-top: 1rem; }
.mt-2  { margin-top: 2rem; }
.mt-3  { margin-top: 3rem; }
.mb-1  { margin-bottom: 1rem; }
.mb-2  { margin-bottom: 2rem; }
.mb-3  { margin-bottom: 3rem; }
.mx-auto { margin-left: auto; margin-right: auto; display: block; }
.gap-1 { gap: 1rem; }
.gap-2 { gap: 2rem; }
.flex  { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 1.5rem; }
.form-group label {
  display: block; font-size: 0.7rem; letter-spacing: 0.18em;
  text-transform: uppercase; font-weight: 500; color: var(--text-mid);
  margin-bottom: 0.5rem; font-family: var(--font-body);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 0.9rem 1.1rem;
  border: 1.5px solid var(--stone); background: var(--cream);
  font-family: var(--font-body); font-size: 0.92rem;
  color: var(--text-dark); border-radius: var(--radius);
  transition: border-color var(--trans); outline: none;
  -webkit-appearance: none; appearance: none;
}
.form-group input:focus-visible,
.form-group textarea:focus-visible,
.form-group select:focus-visible {
  border-color: var(--sage);
  outline: 2px solid var(--sage);
  outline-offset: 2px;
}
/* Soft mouse-only focus (no keyboard) — keep the colour cue but no ring */
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--sage); }
.form-group input[aria-invalid="true"],
.form-group textarea[aria-invalid="true"],
.form-group select[aria-invalid="true"] { border-color: #c64545; }
.form-group textarea { resize: vertical; min-height: 130px; }

/* Select arrow */
.select-wrap { position: relative; }
.select-wrap::after {
  content: '↓'; position: absolute; right: 1rem; top: 50%;
  transform: translateY(-50%); pointer-events: none;
  color: var(--text-light); font-size: 0.8rem;
}

/* ===== ANIMATION HELPERS ===== */
.fade-up {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* ===== DIVIDER ===== */
.divider {
  width: 48px; height: 1px; background: var(--sage);
  margin: 2rem 0;
}
.divider-center { margin: 2rem auto; }

/* F-325: touch-device min target sizes. Applies to phones AND tablets
   (anything with a coarse pointer), independent of viewport width.
   Previously the 44px rule lived under @media(max-width:768px), so on
   tablet portrait (>768px wide but still touch-only) buttons like
   .sched-cancel-btn and "Remove card" stayed below WCAG 2.5.5. */
@media (pointer: coarse) {
  .btn, button, a.sched-zoom-btn { min-height: 44px; }
  .btn-sm { min-height: 44px; padding: 8px 14px; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links, .nav-cta { display: none; }
  .nav-hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  h1 { font-size: 2.4rem; }
  h2 { font-size: 1.9rem; }
  .section { padding: 4.5rem 0; }
  /* iOS input zoom fix — inputs below 16px trigger auto-zoom on focus */
  input, select, textarea, .form-input { font-size: 16px !important; }
  /* Minimum touch targets */
  .btn, button { min-height: 44px; }
  .btn-sm { min-height: 44px; padding: 8px 14px; }   /* was 36px — failed WCAG 2.5.5 touch target */
  /* Table overflow protection */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Stack inline 2-col grids */
  .mobile-stack { grid-template-columns: 1fr !important; }
}

/* ───────────────────────────────────────────────────────────
   F-091 (#48): Print stylesheet.
   Used by:
     - Booking confirmations / receipts (members)
     - Class rosters from the admin schedule
     - The new HTML receipt at /api/my/payments/<id>/receipt
   Targets:
     - Hide chrome (nav, footer, banners, modals, buttons).
     - Force black-on-white text.
     - Single-column layout, generous whitespace, readable line height.
     - Anchors print as plain text (no underline noise).
   ─────────────────────────────────────────────────────────── */
@media print {
  /* Hide every chrome element — keep just <main>'s content. */
  .site-nav, .site-footer, .announcement-bar, .skip-link,
  .auth-overlay, .fap-toast-container, .modal-overlay,
  .sidebar, .admin-sidebar, .admin-topbar,
  #fapCookieBanner, .nav-hamburger, .mobile-menu,
  .btn, button, .schedule-filter-bar, .acct-tabs-bar,
  .account-tabs-bar, #scheduleCtaStrip { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  main, .container, .prose-page { max-width: 100% !important; box-shadow: none !important; }
  a { color: #000 !important; text-decoration: none !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.78em; color: #555; }
  h1, h2, h3 { page-break-after: avoid; }
  table { page-break-inside: avoid; }
  tr, .sched-class { page-break-inside: avoid; }
  /* Pilates-flow / video tiles inappropriate for print. */
  iframe, video, canvas { display: none !important; }
  /* Booking row prints as a clear list line. */
  .sched-class { border-bottom: 1px solid #999; padding: 4px 0 !important; }
}

/* ───────────────────────────────────────────────────────────
   F-100: iOS-style toggle switch used by the admin Operations
   page feature-flags table. Drop-in for `<label class="switch">
   <input type="checkbox"><span></span></label>` without changing
   the layout of any existing form.
   ─────────────────────────────────────────────────────────── */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0;
  background: var(--stone-light, #d8d3cc);
  border-radius: 22px;
  transition: background-color 0.18s ease;
}
.switch span::before {
  content: ''; position: absolute;
  height: 16px; width: 16px;
  left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.switch input:checked + span { background: var(--sage, #7a8a6d); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--sage); outline-offset: 2px; }

/* F-347: universal in-flight button spinner.
   Applied by shared.js fapWithBtnLock() to indicate a request is in
   progress and prevent double-clicks. Was previously defined only in
   contact.css (opacity-only, no spinner), so account / hub / admin
   pages that share fapWithBtnLock showed zero visual feedback while
   2-3 second round-trips ran (e.g. Save Card → tokenize → /api/my/cards).
   The currentColor borrow makes the spinner adapt to btn-primary
   (sage), btn-outline (sage on cream), btn-danger (red), etc. without
   per-variant rules.
   F-350: !important on layout properties so page-specific selectors
   (e.g. account.css .acct-cancel-btn) can't override padding-right or
   opacity. The text-swap in fapWithBtnLock now shows "Processing…"
   inside the button itself, so the spinner is a secondary indicator. */
.btn-loading {
  position: relative !important;
  opacity: 0.65 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  padding-right: 2.6em !important;
}
.btn-loading::after {
  content: '';
  position: absolute;
  right: 0.9em;
  top: 50%;
  width: 1em;
  height: 1em;
  margin-top: -0.5em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: fap-btn-spin 0.55s linear infinite;
  opacity: 0.95;
}
@keyframes fap-btn-spin {
  to { transform: rotate(360deg); }
}
