/*
 * HOPE Health — Global Design System
 * ====================================
 * Single source of truth for base styles, shared animations, and UI components.
 * All pages link to this file.
 */

/* ── Design Tokens (extended palette from doctor patient-chart design) ── */
:root {
  --navy:        #1a2a1a;
  --navy-soft:   #2d3a2d;
  --sage:        #4A7C59;
  --sage-dark:   #3a6347;
  --sage-soft:   #e7efe8;
  --sage-tint:   #f1f5ee;
  --sand:        #e9c46a;
  --sand-soft:   #f5e3b0;
  --sand-tint:   #faecc8;
  --sand-deep:   #8b6a1a;
  --cream:       #F5F1E8;
  --ivory:       #FDFBF6;  /* cards, fields, text on dark; never pure white */
  --cream-deep:  #efe9d8;
  --paper:       #fbf8f0;
  --coral:       #e76f51;
  --coral-soft:  #f6d2c5;
  --coral-tint:  #fbe6dc;
  --coral-deep:  #8e3520;
  --slate:       #64748b;
  --slate-soft:  #94a3b8;
  --line:        #e6dfca;
  --line-soft:   #efe9d8;
  --line-hair:   rgba(26,42,26,0.08);
  /* Added for contrast (design system, Nov 2026) — brand tokens above unchanged */
  --slate-ink:   #5a6577;  /* small secondary text, 5.2:1 on cream */
  --line-strong: #9a9278;  /* field borders, 3.1:1 on ivory */
  --sand-ink:    #6b5212;  /* warning text on sand-tint */
}

/* =============================================
   Reset & Base
   ============================================= */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'General Sans', system-ui, sans-serif;
  color: #1a2a1a;
  background: #F5F1E8;
  overflow-x: hidden;
}

/* =============================================
   Grain Texture Overlay
   ============================================= */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

/* =============================================
   Accessibility Utilities
   ============================================= */

/* Skip to main content — visible on focus */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 100000;
  padding: 12px 24px;
  background: #1a2a1a;
  color: #FDFBF6;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-nav:focus {
  top: 0;
}

/* Visually hidden but screen-reader accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion — respect user OS preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =============================================
   Navigation
   ============================================= */

/* Frosted-glass nav on scroll — targets pill container child */
.nav-scrolled > div:first-child {
  background: rgba(253,251,246, 0.97) !important;
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px rgba(26, 42, 26, 0.08);
}

/* =============================================
   Animations — Scroll Reveal
   ============================================= */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered reveal — children animate in sequence */
.stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.stagger > .reveal:nth-child(2) { transition-delay: 60ms; }
.stagger > .reveal:nth-child(3) { transition-delay: 120ms; }
.stagger > .reveal:nth-child(4) { transition-delay: 180ms; }
.stagger > .reveal:nth-child(5) { transition-delay: 240ms; }
.stagger > .reveal:nth-child(6) { transition-delay: 300ms; }

/* =============================================
   Animations — Hero Entrance
   ============================================= */

.hero-fade { animation: heroFade 1s cubic-bezier(0.22, 1, 0.36, 1) forwards; opacity: 0; }
.hero-fade-delay { animation: heroFade 1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards; opacity: 0; }
.hero-fade-delay-2 { animation: heroFade 1s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards; opacity: 0; }

@keyframes heroFade {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   Animations — Organic Shapes
   ============================================= */

/* Organic blob morph */
.blob {
  border-radius: 42% 58% 62% 38% / 38% 42% 58% 62%;
  animation: morph 12s ease-in-out infinite;
}

@keyframes morph {
  0%,  100% { border-radius: 42% 58% 62% 38% / 38% 42% 58% 62%; }
  25%       { border-radius: 52% 48% 38% 62% / 58% 32% 68% 42%; }
  50%       { border-radius: 38% 62% 52% 48% / 42% 58% 42% 58%; }
  75%       { border-radius: 62% 38% 42% 58% / 48% 62% 38% 52%; }
}

/* Floating decorative elements */
.float       { animation: float 6s ease-in-out infinite; }
.float-delay { animation: float 6s ease-in-out 2s infinite; }

@keyframes float {
  0%,  100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}

/* =============================================
   Components — Buttons
   ============================================= */

/* Primary CTA — sage blue pill with arrow */
.btn-primary {
  background: #4A7C59;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn-primary:hover:not(:disabled) {
  background: #3a6347;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(74, 124, 89, 0.3);
}
.btn-primary .btn-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(253,251,246,0.2);
  transition: background 0.3s ease;
}
.btn-primary:hover .btn-arrow {
  background: rgba(253,251,246,0.3);
}

/* Secondary CTA — outlined / ghost */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn-secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26, 42, 26, 0.15);
}

/* =============================================
   Components — Cards
   ============================================= */

/* Hover lift — used on feature / info cards */
.card-lift {
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.card-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(26, 42, 26, 0.08);
}

/* Treatment card — gradient top-border on hover */
.treatment-card {
  position: relative;
  overflow: hidden;
}
.treatment-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4A7C59, #e9c46a, #e76f51);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.treatment-card:hover::before {
  opacity: 1;
}

/* =============================================
   Components — FAQ Accordion
   ============================================= */

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1), padding 0.4s ease;
  padding: 0 24px;
}
.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 0 24px 20px;
}
.faq-item.active .faq-icon {
  transform: rotate(45deg);
}
.faq-icon {
  transition: transform 0.3s ease;
}

/* =============================================
   Components — Decorative
   ============================================= */

/* Gradient accent line (sage → sand) */
.accent-line {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, #4A7C59, #e9c46a);
  border-radius: 2px;
}

/* Star ratings */
.star { color: #e9c46a; }

/* Animated number counters */
.counter { display: inline-block; }

/* =============================================
   Components — Announcement Banner
   ============================================= */

/* Announcement banner */
.announcement-bar {
  background: #1a2a1a;
  color: rgba(253,251,246,0.9);
  font-size: 0.8125rem;
  text-align: center;
  padding: 10px 24px;
  letter-spacing: 0.01em;
  position: relative;
  z-index: 51;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.announcement-bar.dismissed {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* Active nav link indicator */
.nav-link-active {
  color: #4A7C59 !important;
  position: relative;
}
.nav-link-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #4A7C59;
}
.announcement-bar a {
  color: #e9c46a;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}
.announcement-bar a:hover { color: #FDFBF6; }

/* =============================================
   Components — Stats Accent Bars
   ============================================= */

/* Stats with colored accent bars (Ada-style) */
.stat-bar { position: relative; padding-left: 20px; }
.stat-bar::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  height: 48px;
  width: 4px;
  border-radius: 2px;
}
.stat-bar--sage::before { background: #4A7C59; }
.stat-bar--coral::before { background: #e76f51; }
.stat-bar--sand::before { background: #e9c46a; }
.stat-bar--navy::before { background: #1a2a1a; }

/* =============================================
   Components — Dark Section Utility
   ============================================= */

/* Dark section — trust/compliance blocks */
.section-dark {
  background: #1a2a1a;
  color: #FDFBF6;
}
.section-dark .accent-line {
  background: linear-gradient(90deg, #4A7C59, #e9c46a);
}

/* =============================================
   Components — Dot-Grid Background
   ============================================= */

/* Dot-grid pattern (Ada-style CTA bg) */
.dot-grid {
  background-image: radial-gradient(circle, rgba(253,251,246,0.15) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* =============================================
   Components — Scrolling Logo Ticker
   ============================================= */

/* Scrolling logo ticker */
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.logo-ticker {
  display: flex;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.logo-ticker-track {
  display: flex;
  align-items: center;
  gap: 48px;
  animation: ticker 30s linear infinite;
  flex-shrink: 0;
}

/* =============================================
   Components — Footer
   ============================================= */

/* Footer column headers — colored */
.footer-heading {
  color: #4A7C59;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* =============================================
   PWA — App Shell Styles
   ============================================= */

/* ── Page Transitions ── */
.pwa-page-enter {
  opacity: 0;
  transform: translateY(8px);
}
.pwa-page-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.pwa-page-exit {
  opacity: 0 !important;
  transform: translateY(-6px) !important;
  transition: opacity 0.18s ease, transform 0.18s ease !important;
}

/* ── Bottom Navigation Bar ── */
#pwa-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: none;
  align-items: stretch;
  justify-content: space-around;
  background: rgba(253,251,246, 0.97);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(26, 42, 26, 0.06);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -2px 20px rgba(26, 42, 26, 0.06);
}

@media (max-width: 768px) {
  #pwa-bottom-nav { display: flex; }
  /* Padding only on pages that actually render the bottom nav */
  body.has-bottom-nav { padding-bottom: 76px !important; }

  /* Doctor page header: offset for fixed hamburger button (left-4 + p-2 + icon ≈ 56px) */
  .main-content > header {
    padding-left: 64px !important;
  }
}

/* In standalone mode, always show bottom nav */
.pwa-standalone #pwa-bottom-nav { display: flex; }
.pwa-standalone body.has-bottom-nav { padding-bottom: 76px !important; }

.pwa-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 16px;
  text-decoration: none;
  color: #64748b;
  transition: color 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.pwa-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.pwa-nav-label {
  font-family: 'General Sans', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.pwa-nav-active {
  color: #4A7C59;
}
.pwa-nav-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: #4A7C59;
  border-radius: 0 0 2px 2px;
}

.pwa-nav-item:active {
  transform: scale(0.92);
}

/* ── Install Banner ── */
#pwa-install-banner {
  position: fixed;
  bottom: 80px;
  left: 12px;
  right: 12px;
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

#pwa-install-banner.pwa-install-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.pwa-install-inner {
  background: #FDFBF6;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(26, 42, 26, 0.12), 0 2px 8px rgba(26, 42, 26, 0.06);
  border: 1px solid rgba(26, 42, 26, 0.06);
}

.pwa-install-content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pwa-install-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pwa-install-action-btn {
  padding: 8px 18px;
  background: #4A7C59;
  color: #FDFBF6;
  border: none;
  border-radius: 9999px;
  font-family: 'General Sans', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, transform 0.15s;
}
.pwa-install-action-btn:active { transform: scale(0.96); background: #3a6347; }

.pwa-dismiss-action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.pwa-dismiss-action-btn:active { background: rgba(0,0,0,0.04); }

/* ── Pull to Refresh Indicator ── */
#pwa-pull-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-40px);
  z-index: 10001;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FDFBF6;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(26, 42, 26, 0.12);
  transition: opacity 0.3s ease;
  opacity: 0;
}

.pwa-pull-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(74, 124, 89, 0.2);
  border-top-color: #4A7C59;
  border-radius: 50%;
  animation: pwa-spin 0.6s linear infinite;
}

@keyframes pwa-spin {
  to { transform: rotate(360deg); }
}

/* ── Connectivity Toast ── */
.pwa-toast {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 10002;
  padding: 10px 20px;
  border-radius: 9999px;
  font-family: 'General Sans', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.pwa-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pwa-toast-online {
  background: #4A7C59;
  color: #FDFBF6;
}

.pwa-toast-offline {
  background: #e76f51;
  color: #FDFBF6;
}

/* ── Standalone Mode Adjustments ── */
.pwa-standalone {
  /* Account for iOS notch / status bar */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

.pwa-standalone body {
  padding-top: var(--sat);
  padding-bottom: calc(76px + var(--sab));
}

/* In standalone mode, adjust top nav for status bar */
.pwa-standalone nav[style*="position: fixed"],
.pwa-standalone nav[style*="position:fixed"],
.pwa-standalone .announcement-bar {
  padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
}

/* ── Touch Feedback ── */
@media (hover: none) and (pointer: coarse) {
  /* Native-feel tap states */
  a, button {
    -webkit-tap-highlight-color: transparent;
  }

  .btn-primary:active {
    transform: scale(0.97) !important;
    transition-duration: 0.1s !important;
  }

  .btn-secondary:active {
    transform: scale(0.97) !important;
    transition-duration: 0.1s !important;
  }

  .card-lift:active {
    transform: scale(0.98) !important;
    transition-duration: 0.1s !important;
  }
}

/* ── Mobile-First Scroll Snap (dashboard views) ── */
@media (max-width: 768px) {
  .pwa-standalone .announcement-bar {
    display: none;
  }

  /* Smoother scrolling on iOS */
  main, [role="main"], .overflow-y-auto {
    -webkit-overflow-scrolling: touch;
  }

  /* Prevent text selection on nav elements */
  #pwa-bottom-nav {
    -webkit-user-select: none;
    user-select: none;
  }
}

/* =============================================
   Insurance Request Status Chips
   Reuses existing sage / sand / coral / slate tokens.
   ============================================= */

.chip-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.4;
  white-space: nowrap;
}

.chip-status-draft                 { background: #F1F5F9; color: #64748b; }
.chip-status-pending_review        { background: #E8F0EB; color: #3a6347; }
.chip-status-pending_admin_review  { background: #FCEFD2; color: #8a6d1c; }
.chip-status-pending_doctor_review { background: #DCE8E1; color: #2d5238; }
.chip-status-changes_requested     { background: #FAF0D5; color: #1a2a1a; }
.chip-status-approved_by_doctor    { background: #E8F0EB; color: #3a6347; }
.chip-status-submitted          { background: #4A7C59; color: #F5F1E8; }
.chip-status-approved           { background: #4A7C59; color: #F5F1E8; }
.chip-status-denied             { background: #FDE4DC; color: #e76f51; }
.chip-status-info_requested     { background: #FAF0D5; color: #1a2a1a; }
.chip-status-withdrawn          { background: #F1F5F9; color: #64748b; }

/* ===== Unified site navigation (.hn-) — shared by marketing + legacy patient pages ===== */
.hn{position:sticky;top:0;z-index:1000;background:rgba(245,241,232,0.88);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-bottom:1px solid rgba(26,42,26,0.10);}
.hn-inner{max-width:1200px;margin:0 auto;padding:15px 32px;display:flex;align-items:center;justify-content:space-between;gap:24px;}
.hn-brand{display:inline-flex;align-items:baseline;gap:6px;text-decoration:none;flex:0 0 auto;}
.hn-brand b{font-family:'Clash Display',sans-serif;font-weight:600;font-size:24px;letter-spacing:-0.025em;color:#1a2a1a;}
.hn-brand i{font-style:normal;font-family:'General Sans',sans-serif;font-weight:500;font-size:10px;letter-spacing:0.22em;text-transform:uppercase;color:#64748b;}
.hn-links{display:flex;align-items:center;gap:4px;}
.hn-links a{display:inline-flex;align-items:center;gap:7px;padding:9px 15px;border-radius:999px;font-family:'General Sans',sans-serif;font-size:14.5px;font-weight:500;color:#1a2a1a;text-decoration:none;transition:background .15s,color .15s;}
.hn-links a:hover{background:rgba(74,124,89,0.10);color:#3a6347;}
.hn-links a.active{color:#3a6347;background:rgba(74,124,89,0.14);}
.hn-cta{background:#4A7C59;color:#FDFBF6!important;}
.hn-cta:hover{background:#3a6347!important;color:#FDFBF6!important;}
.hn-cta svg{width:14px;height:14px;}
.hn-toggle{display:none;flex-direction:column;justify-content:center;align-items:center;gap:5px;background:none;border:none;cursor:pointer;padding:8px;margin:-8px;min-width:44px;min-height:44px;}
.hn a:focus-visible,.hn button:focus-visible,.hn-footer a:focus-visible{outline:2px solid #3a6347;outline-offset:2px;}
.hn-toggle span{display:block;width:24px;height:2px;background:#1a2a1a;border-radius:2px;transition:transform .25s,opacity .2s;}
@media (max-width:860px){
  .hn-inner{padding:13px 20px;}
  .hn-toggle{display:flex;}
  .hn-links{position:absolute;top:100%;left:0;right:0;flex-direction:column;align-items:stretch;gap:2px;background:#F5F1E8;border-bottom:1px solid rgba(26,42,26,0.10);padding:12px 18px 20px;transform:translateY(-10px);opacity:0;visibility:hidden;transition:opacity .2s,transform .2s,visibility .2s;box-shadow:0 18px 32px rgba(26,42,26,0.10);}
  .hn-links.open{transform:translateY(0);opacity:1;visibility:visible;}
  .hn-links a{padding:13px 14px;font-size:16px;justify-content:flex-start;}
  .hn-cta{justify-content:center;margin-top:8px;}
  .hn-toggle.open span:nth-child(1){transform:translateY(7px) rotate(45deg);}
  .hn-toggle.open span:nth-child(2){opacity:0;}
  .hn-toggle.open span:nth-child(3){transform:translateY(-7px) rotate(-45deg);}
}

/* ===== Unified marketing footer (.hn-footer) — legacy patient pages ===== */
.hn-footer{background:#F5F1E8;border-top:1px solid rgba(26,42,26,0.10);padding:56px 32px 40px;font-family:'General Sans',sans-serif;}
.hn-footer-inner{max-width:1200px;margin:0 auto;}
.hn-footer-top{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:20px 32px;}
.hn-footer-links{display:flex;flex-wrap:wrap;gap:8px 22px;}
.hn-footer-links a{font-size:13.5px;font-weight:500;color:#1a2a1a;text-decoration:none;}
.hn-footer-links a:hover{color:#3a6347;}
.hn-footer-fine{margin-top:28px;max-width:780px;font-size:11.5px;line-height:1.65;color:#5a6577;}
.hn-footer-copy{margin-top:18px;font-size:12px;color:#5a6577;}

/* ===== Public pages on the .hn nav (about, privacy, terms, cookies, accessibility) =====
   Design-system colour + type rules (Nov 2026). Scoped to content that follows the
   marketing nav, so doctor/admin/portal pages that also load global.css are unaffected.
   Selectors out-rank the Tailwind CDN utilities without !important. */
.hn ~ main .text-slate{color:#5a6577;}                 /* slate-ink: 5.2:1 on cream */
.hn ~ main a.text-sage,.hn ~ main p.text-sage,.hn ~ main span.text-sage{color:#3a6347;} /* sage-dark for small text/links */
.hn ~ main a.text-sage:hover{color:#1a2a1a;}
.hn ~ main .text-coral:not(svg){color:#8e3520;}        /* coral-deep for text */
.hn ~ main .text-navy\/60{color:rgba(26,42,26,0.74);}
.hn ~ main :is(h1,h2,h3,h4).font-display,.hn ~ main .legal-prose :is(h1,h2,h3){font-family:'Clash Display',system-ui,sans-serif;font-weight:500;}
.hn ~ main a:focus-visible,.hn ~ main button:focus-visible{outline:2px solid #3a6347;outline-offset:2px;border-radius:4px;}

/* ===== Native form controls in brand colours (issue 31) =====
   Checkboxes/radios otherwise render browser-blue, and file inputs show the
   default grey "Choose File" button. */
input[type="checkbox"], input[type="radio"] { accent-color: #4A7C59; }
input[type="file"] { font-family: 'General Sans', system-ui, sans-serif; font-size: 13px; color: #64748b; }
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 8px 16px;
  border: 0; border-radius: 999px;
  background: rgba(74,124,89,0.10); color: #3a6347;
  font: 600 13px 'General Sans', system-ui, sans-serif;
  cursor: pointer; transition: background-color .15s ease;
}
input[type="file"]::file-selector-button:hover { background: rgba(74,124,89,0.18); }
