/* =========================================================================
   Appiia Health — Global Stylesheet
   Static site. All styles in one file.
   ========================================================================= */

/* ------------------------------ Reset / base --------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: #333333;
  background: #FFFFFF;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; height: auto; }
a { color: #6B3FA0; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: 'Inter', sans-serif; color: #1F3864; line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(30px, 5vw, 48px); font-weight: 700; }
h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 700; }
h3 { font-size: clamp(19px, 2.4vw, 24px); font-weight: 600; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid #6B3FA0; outline-offset: 2px; }

/* ------------------------------ Layout --------------------------------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section--tint { background: #F3EDF9; }
.section--gray { background: #F5F5F5; }
.section--blue { background: #E8EDF5; }
.section--navy { background: #1F3864; color: #fff; }
.section--navy h1, .section--navy h2, .section--navy h3 { color: #fff; }
.eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 13px; font-weight: 600; color: #6B3FA0; margin: 0 0 12px; }
.lead { font-size: clamp(17px, 2vw, 20px); color: #595959; max-width: 720px; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }
@media (max-width: 768px) { .section { padding: 48px 0; } }

/* ------------------------------ Buttons -------------------------------- */
.btn {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 16px;
  padding: 14px 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #6B3FA0;
  color: #fff;
  box-shadow: 0 2px 8px rgba(107, 63, 160, 0.25);
  transition: background 0.2s ease, transform 0.15s ease;
}
.btn:hover { background: #563283; text-decoration: none; color: #fff; transform: translateY(-1px); }
.btn--outline { background: transparent; color: #6B3FA0; box-shadow: inset 0 0 0 2px #6B3FA0; }
.btn--outline:hover { background: #6B3FA0; color: #fff; }
.btn--light { background: #fff; color: #1F3864; }
.btn--light:hover { background: #F3EDF9; color: #1F3864; }
.btn--lg { padding: 18px 44px; font-size: 18px; }

/* ------------------------------ Header / Nav --------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  border-bottom: 1px solid #eee;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px; margin: 0 auto; padding: 14px 24px; gap: 24px;
}
.nav__logo img { width: 170px; height: auto; }
/* Light (non-home) headers use the dark logo file directly; home header + footer use the white file. */
.nav__menu { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav__link { color: #1F3864; font-weight: 500; font-size: 15px; padding: 8px 0; }
.nav__link:hover { color: #6B3FA0; text-decoration: none; }

/* Dropdowns */
.nav__item--has-dropdown { position: relative; }
.nav__dropdown-toggle { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; font: inherit; color: #1F3864; font-weight: 500; font-size: 15px; cursor: pointer; padding: 8px 0; }
.nav__dropdown-toggle:hover { color: #6B3FA0; }
.nav__dropdown-toggle .caret { font-size: 10px; transition: transform 0.2s ease; }
.nav__dropdown {
  position: absolute; top: 100%; left: 0; min-width: 240px;
  background: #fff; border: 1px solid #eee; border-radius: 10px;
  box-shadow: 0 12px 30px rgba(31, 56, 100, 0.12);
  padding: 8px; list-style: none; margin: 8px 0 0;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.nav__item--has-dropdown:hover .nav__dropdown,
.nav__item--has-dropdown:focus-within .nav__dropdown,
.nav__dropdown.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.nav__dropdown a { display: block; padding: 10px 14px; border-radius: 7px; color: #333; font-size: 15px; font-weight: 500; }
.nav__dropdown a:hover { background: #F3EDF9; color: #6B3FA0; text-decoration: none; }
.nav__cta { white-space: nowrap; }

/* Hamburger */
.nav__toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; z-index: 210; }
.nav__toggle span { display: block; width: 26px; height: 2px; background: #1F3864; margin: 5px 0; transition: transform 0.3s ease, opacity 0.3s ease; }

/* ---- Homepage dark-mode nav (overlays video) ---- */
.site-header--home {
  position: fixed; left: 0; right: 0; top: 0;
  background: transparent; border-bottom: 1px solid transparent;
}
.site-header--home .nav__logo img { filter: none; } /* white logo already white */
.site-header--home .nav__link,
.site-header--home .nav__dropdown-toggle { color: #fff; }
.site-header--home .nav__link:hover,
.site-header--home .nav__dropdown-toggle:hover { color: #E3DDF2; }
.site-header--home .nav__toggle span { background: #fff; }
/* Scrolled state on homepage */
.site-header--home.is-scrolled {
  position: fixed;
  background: hsl(201, 100%, 13%);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}
/* Homepage dark dropdown panel stays readable */
.site-header--home .nav__dropdown a { color: #333; }

/* ------------------------------ Hero (dark cinematic) ------------------ */
.hero-wrapper {
  position: relative; min-height: 100vh; overflow: hidden;
  background:
    radial-gradient(130% 90% at 50% 6%, hsl(201, 78%, 22%) 0%, hsl(201, 100%, 13%) 42%, hsl(210, 100%, 7%) 100%);
}
/* Cinematic CSS starfield (two twinkling, tiled layers) — no images, no people, no flowers */
.hero-stars {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    radial-gradient(1.6px 1.6px at 40px 60px, #ffffff, transparent),
    radial-gradient(1.4px 1.4px at 130px 22px, rgba(255,255,255,0.85), transparent),
    radial-gradient(1.2px 1.2px at 220px 120px, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.7px 1.7px at 300px 200px, #ffffff, transparent),
    radial-gradient(1.1px 1.1px at 360px 80px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.3px 1.3px at 80px 230px, rgba(255,255,255,0.8), transparent),
    radial-gradient(1.2px 1.2px at 180px 290px, rgba(255,255,255,0.65), transparent),
    radial-gradient(1.5px 1.5px at 275px 45px, #ffffff, transparent);
  background-repeat: repeat;
  background-size: 400px 320px;
  animation: twinkle 6s ease-in-out infinite;
}
.hero-stars--2 {
  background-size: 300px 260px; opacity: 0.55;
  animation: twinkle 9s ease-in-out infinite reverse;
}
@keyframes twinkle { 0%, 100% { opacity: 0.55; } 50% { opacity: 0.95; } }
/* Vignette for text contrast, sits above the stars */
.video-overlay {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(120% 75% at 50% 42%, rgba(0,20,40,0) 40%, rgba(0,20,40,0.45) 100%),
    linear-gradient(180deg, rgba(0,20,40,0.35) 0%, rgba(0,20,40,0.05) 35%, rgba(0,20,40,0.5) 100%);
}
/* Optional lifestyle photo layer behind the starfield (homepage hero test) */
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero-wrapper--photo .video-overlay {
  background:
    radial-gradient(120% 85% at 50% 38%, rgba(3,18,32,0.42) 0%, rgba(3,18,32,0.74) 100%),
    linear-gradient(180deg, rgba(3,18,32,0.70) 0%, rgba(3,18,32,0.50) 42%, rgba(3,18,32,0.84) 100%);
}
@media (prefers-reduced-motion: reduce) { .hero-stars { animation: none; } }
.hero-content {
  position: relative; z-index: 10;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 140px 24px 60px; gap: 26px;
}
.hero-content h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: clamp(40px, 7.5vw, 84px);
  line-height: 0.95; letter-spacing: -2.2px;
  color: #fff; margin: 0; max-width: 15ch;
}
.hero-content h1 em { font-style: normal; color: hsl(240, 4%, 66%); }
.hero-subhead {
  color: hsl(240, 4%, 66%);
  max-width: 580px; margin: 0;
  font-size: clamp(14px, 1.8vw, 17px); line-height: 1.75;
}
.hero-phone { color: hsl(240, 4%, 66%); letter-spacing: 2px; font-size: 15px; margin-top: 8px; }
.hero-phone:hover { color: #fff; text-decoration: none; }

/* Trust bar */
.trust-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; margin-top: 8px; }
.trust-bar__item { display: inline-flex; align-items: center; gap: 8px; color: hsl(240, 4%, 66%); font-size: 12px; }
.trust-bar__check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255,255,255,0.12); color: #fff; font-size: 11px;
}

/* Liquid glass button (hero CTA + home nav CTA) */
.liquid-glass {
  background: rgba(255, 255, 255, 0.01);
  background-blend-mode: luminosity;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  border: none; color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
  position: relative; overflow: hidden;
  border-radius: 9999px;
  font-weight: 600; font-family: 'Inter', sans-serif; cursor: pointer;
  transition: transform 0.2s ease;
}
.liquid-glass:hover { transform: scale(1.03); text-decoration: none; color: #fff; }
.liquid-glass::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.4px;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.15) 20%,
    rgba(255,255,255,0) 40%, rgba(255,255,255,0) 60%,
    rgba(255,255,255,0.15) 80%, rgba(255,255,255,0.45) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.hero-cta { padding: 19px 52px; font-size: 17px; }
.nav__cta--glass { padding: 11px 26px; font-size: 15px; }

/* Fade-rise entrance animations */
@keyframes fade-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.anim-0 { animation: fade-rise 0.8s ease-out both; }
.anim-1 { animation: fade-rise 0.8s ease-out 0.2s both; }
.anim-2 { animation: fade-rise 0.8s ease-out 0.4s both; }
.anim-3 { animation: fade-rise 0.8s ease-out 0.6s both; }
@media (prefers-reduced-motion: reduce) {
  .anim-0, .anim-1, .anim-2, .anim-3 { animation: none; }
  html { scroll-behavior: auto; }
}

/* ------------------------------ Page hero (light) ---------------------- */
.page-hero { padding: 72px 0; background: #F3EDF9; }
.page-hero--plain { background: #fff; }
.page-hero__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.page-hero__grid--reverse { grid-template-columns: 1fr 1.1fr; }
.page-hero h1 { margin-bottom: 16px; }
.page-hero img, .page-hero .image-placeholder { border-radius: 14px; box-shadow: 0 20px 50px rgba(31,56,100,0.14); }
@media (max-width: 860px) { .page-hero__grid, .page-hero__grid--reverse { grid-template-columns: 1fr; } }

/* ------------------------------ Grids / cards -------------------------- */
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid #ececf1; border-radius: 14px; padding: 24px;
  box-shadow: 0 4px 18px rgba(31,56,100,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(31,56,100,0.10); }
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; color: #595959; }
.card__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 12px;
  background: #F3EDF9; color: #6B3FA0; margin-bottom: 14px; font-size: 22px;
}

/* Numbered steps */
.steps { display: grid; gap: 28px; grid-template-columns: repeat(3, 1fr); counter-reset: step; }
.steps--5 { grid-template-columns: repeat(5, 1fr); }
.steps--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .steps, .steps--4, .steps--5 { grid-template-columns: 1fr; } }
.step { }
.step__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: #6B3FA0; color: #fff; font-weight: 700; font-size: 18px; margin-bottom: 14px;
}
.step h3 { margin-bottom: 6px; }
.step p { color: #595959; margin: 0; }

/* Checklist */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.checklist li { position: relative; padding-left: 34px; color: #333; }
.checklist li::before {
  content: '✓'; position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 50%;
  background: #6B3FA0; color: #fff; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}

/* Two-column feature (text + image) */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.feature--reverse .feature__media { order: -1; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } .feature--reverse .feature__media { order: 0; } }
.feature__media img, .feature__media .image-placeholder { border-radius: 14px; box-shadow: 0 16px 40px rgba(31,56,100,0.12); }

/* Image placeholder */
.image-placeholder {
  background: #E8E0F0; min-height: 300px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center;
}
.image-placeholder p { color: #666; font-style: italic; margin: 0; }

/* ------------------------------ Table ---------------------------------- */
.table-wrap { overflow-x: auto; }
.program-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.program-table th, .program-table td { text-align: left; padding: 16px 18px; border-bottom: 1px solid #e6e6ee; }
.program-table thead th { background: #E8EDF5; color: #1F3864; font-weight: 700; }
.program-table td:first-child { font-weight: 600; color: #1F3864; width: 34%; }

/* ------------------------------ FAQ accordion -------------------------- */
.faq { max-width: 820px; margin: 0 auto; }
.faq__item { border: 1px solid #e6e6ee; border-radius: 12px; margin-bottom: 14px; overflow: hidden; background: #fff; }
.faq__q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 17px; color: #1F3864;
  padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq__q .faq__icon { flex: none; font-size: 22px; color: #6B3FA0; transition: transform 0.25s ease; }
.faq__item.is-open .faq__icon { transform: rotate(45deg); }
.faq__a { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq__a-inner { padding: 0 24px 20px; color: #595959; }

/* ------------------------------ Forms ---------------------------------- */
.form { max-width: 640px; margin: 0 auto; display: grid; gap: 18px; }
.form[hidden] { display: none; } /* [hidden] must beat display:grid */
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 600px) { .form__row { grid-template-columns: 1fr; } }
.form label { display: block; font-weight: 600; font-size: 14px; color: #1F3864; margin-bottom: 6px; }
.form input, .form select, .form textarea {
  width: 100%; font-family: 'Inter', sans-serif; font-size: 16px; color: #333;
  padding: 12px 14px; border: 1px solid #cfcfe0; border-radius: 8px; background: #fff;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: #6B3FA0; box-shadow: 0 0 0 3px rgba(107,63,160,0.15); }
.form textarea { min-height: 120px; resize: vertical; }
.form__error {
  max-width: 640px; margin: 0 auto; color: #B4302A;
  background: #FCEBEA; border: 1px solid #F3C6C2; border-radius: 8px; padding: 12px 16px;
}
.form__error:focus { outline: none; }
.form__success {
  max-width: 640px; margin: 24px auto 0; text-align: center;
  background: #EAF7F0; border: 1px solid #C5E8D6; border-radius: 12px; padding: 24px;
}
.form__success h3 { color: #2E7D5B; margin: 0 0 6px; }
.form__success:focus { outline: none; }

/* CTA band */
.cta-band { text-align: center; }
.cta-band h2 { margin-bottom: 20px; }

/* ------------------------------ Footer --------------------------------- */
.site-footer { background: #1F3864; color: #cdd6e6; padding: 64px 0 32px; }
.site-footer a { color: #cdd6e6; }
.site-footer a:hover { color: #fff; }
.footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
@media (max-width: 900px) { .footer__top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer__top { grid-template-columns: 1fr; } }
.footer__logo img { width: 170px; margin-bottom: 16px; } /* white logo already white */
.footer__tagline { font-size: 14px; color: #aab6cd; max-width: 300px; }
.footer__col h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 15px; }
.footer__crisis {
  margin-top: 40px; padding: 18px 20px; border-radius: 10px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  font-size: 14px; color: #e6ecf7; text-align: center;
}
.footer__crisis strong { color: #fff; }
.footer__bottom { margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 13px; color: #93a1bd; text-align: center; }

/* ------------------------------ Mobile nav overlay --------------------- */
@media (max-width: 980px) {
  .nav__toggle { display: block; }
  .nav__menu {
    position: fixed; inset: 0; z-index: 200;
    flex-direction: column; justify-content: center; align-items: center; gap: 8px;
    background: rgba(15, 28, 46, 0.92);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    padding: 80px 24px 40px;
    transform: translateX(100%); transition: transform 0.35s ease;
    overflow-y: auto;
  }
  .nav__menu.is-open { transform: translateX(0); }
  .nav__link, .nav__dropdown-toggle { color: #fff !important; font-size: 20px; }
  .nav__item { width: 100%; text-align: center; }
  .nav__dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    background: transparent; border: none; box-shadow: none; min-width: 0;
    max-height: 0; overflow: hidden; margin: 0; padding: 0;
    transition: max-height 0.3s ease;
  }
  .nav__dropdown.is-open { max-height: 400px; }
  .nav__dropdown a { color: #cdd6e6 !important; text-align: center; font-size: 16px; }
  .nav__dropdown a:hover { background: rgba(255,255,255,0.08); }
  .nav__cta { margin-top: 14px; }
  body.nav-open { overflow: hidden; }
  /* Hamburger -> X */
  .nav__toggle.is-open span { background: #fff; }
  .nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* Utility */
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.stack > * + * { margin-top: 16px; }
.muted { color: #595959; }
