/* =========================================================
   Pilots for Patients — public site styles
   Modern, dependency-free. Shared across all public pages.
   ========================================================= */

:root {
  /* Palette sampled from the PFP logo — GREEN primary */
  --navy:   #00502a;   /* primary deep green (logo hills) — dark surfaces & headings */
  --navy-2: #0c7a3e;   /* brighter green for gradients */
  --blue:   #0a7740;   /* interactive green (links/buttons) */
  --blue-d: #005c31;   /* deep green for CTA gradient/hover */
  --sky:    #e4f1e9;   /* soft green tint */
  --gold:   #f0a848;   /* logo orange-gold (sunburst rays) */
  --gold-d: #c47e1a;   /* darker amber for text/hover */
  --green:  #006030;   /* logo green — check marks & accents */
  --yellow: #f0d21f;   /* logo bright yellow (sunburst center) */
  --indigo: #301860;   /* logo indigo — now a secondary accent */
  --ink:    #16231b;   /* near-black with a green cast */
  --muted:  #5c6660;
  --line:   #e2ebe5;
  --bg:     #ffffff;
  --bg-alt: #f4faf6;   /* very light green tint */

  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(11,44,77,.06), 0 2px 8px rgba(11,44,77,.05);
  --shadow-md: 0 6px 24px rgba(11,44,77,.10);
  --maxw: 1140px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;   /* prevent iPad landscape text inflation */
  text-size-adjust: 100%;
  /* Brand accent bar using all four logo colors */
  border-top: 5px solid;
  border-image: linear-gradient(90deg, var(--indigo) 0%, var(--green) 38%, var(--gold) 72%, var(--yellow) 100%) 1;
}

h1, h2, h3 { line-height: 1.2; color: var(--navy); margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.25rem; }

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--alt { background: var(--bg-alt); }
.section--navy { background: var(--navy); color: #d7ece0; }
.section--navy h2, .section--navy h3 { color: #fff; }
.center { text-align: center; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 56ch; }
.center .lead { margin-inline: auto; }
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: .12em;
  font-size: .78rem; font-weight: 700; color: var(--gold-d); margin-bottom: .6rem;
}
.section--navy .eyebrow { color: var(--gold); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.3rem; border-radius: 999px; font-weight: 600;
  border: 2px solid transparent; cursor: pointer; transition: .18s ease;
  text-decoration: none; font-size: .98rem;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-d); }
.btn-gold { background: var(--gold); color: #2a1c00; }
.btn-gold:hover { background: var(--gold-d); color: #2a1c00; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-on-navy { background: #fff; color: var(--navy); }
.btn-on-navy:hover { background: var(--sky); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  min-height: 72px; /* reserve space while nav.js renders — prevents layout shift */
  background: rgba(255,255,255,.95);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  box-shadow: 0 1px 0 var(--line), 0 4px 24px rgba(0,80,42,.07);
}
.nav-wrap { display: flex; align-items: center; gap: 1rem; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--navy); font-weight: 800; }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; color: var(--blue); }
.brand-logo { height: 52px; width: auto; display: block; }
.brand-text { font-size: 1.12rem; letter-spacing: -.01em; }
.brand-text em { font-style: normal; color: var(--gold-d); font-weight: 700; }
@media (max-width: 480px) { .brand-logo { height: 42px; } }

.main-nav { margin-left: auto; }
/* `> ul` (direct child only) so these list rules never cascade into the nested
   `.dropdown` <ul> — that leak caused the dropdown flex/padding bugs. */
.main-nav > ul { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0; }

.main-nav a {
  position: relative;
  display: block; padding: .55rem .9rem;
  border-radius: 8px;
  color: var(--muted); font-weight: 500;
  font-size: .95rem;
  transition: color .18s ease, background .18s ease;
  text-decoration: none;
}

/* sliding underline */
.main-nav a::after {
  content: '';
  position: absolute; left: .9rem; right: .9rem; bottom: .3rem;
  height: 2px; border-radius: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .22s ease;
}
.main-nav a:hover {
  color: var(--navy);
  background: var(--sky);
  text-decoration: none;
}
.main-nav a:hover::after { transform: scaleX(1); }

/* active page */
.main-nav a[aria-current="page"] {
  color: var(--navy);
  font-weight: 700;
}
.main-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- Dropdowns (desktop) ---------- */
.has-dropdown { position: relative; }
.nav-parent {
  position: relative;
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .55rem .9rem;
  font: inherit; font-size: .95rem; font-weight: 500;
  color: var(--muted); background: none; border: 0; border-radius: 8px;
  cursor: pointer;
  transition: color .18s ease, background .18s ease;
}
.nav-parent:hover { color: var(--navy); background: var(--sky); }
.nav-parent .caret { width: 14px; height: 14px; transition: transform .2s ease; }
.has-dropdown:hover .nav-parent .caret,
.has-dropdown:focus-within .nav-parent .caret { transform: rotate(180deg); }

/* sliding underline to match top-level links */
.nav-parent::after {
  content: ''; position: absolute; left: .9rem; right: 1.7rem; bottom: .3rem;
  height: 2px; border-radius: 2px; background: var(--gold);
  transform: scaleX(0); transform-origin: left center; transition: transform .22s ease;
}
.nav-parent:hover::after,
.nav-parent[data-active]::after { transform: scaleX(1); }
.nav-parent[data-active] { color: var(--navy); font-weight: 700; }

.dropdown {
  position: absolute; top: calc(100% + .35rem); left: 0;
  min-width: 220px;
  list-style: none; margin: 0; padding: .4rem;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,80,42,.14);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 60;
}
.has-dropdown:hover > .dropdown,
.has-dropdown:focus-within > .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown a {
  display: block; padding: .55rem .7rem; border-radius: 8px;
  color: var(--ink); font-size: .92rem; font-weight: 500;
}
.dropdown a::after { display: none; }
.dropdown a:hover { background: var(--sky); color: var(--navy); }
.dropdown a[aria-current="page"] { background: var(--sky); color: var(--navy); font-weight: 700; }

.header-cta { margin-left: .75rem; }
.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 0; padding: .4rem; cursor: pointer; color: var(--navy);
}
.nav-toggle svg { width: 28px; height: 28px; }

@media (max-width: 920px) {
  .header-cta { display: none; }
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute; top: 72px; left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(0,80,42,.08);
    margin: 0; max-height: 0; overflow: hidden; transition: max-height .28s ease;
  }
  .main-nav.open { max-height: 480px; }
  .main-nav > ul { flex-direction: column; padding: .5rem 1.25rem 1.25rem; gap: 0; }
  .main-nav a {
    padding: .8rem .5rem; border-bottom: 1px solid var(--line); border-radius: 0;
    color: var(--ink);
  }
  .main-nav a::after { display: none; }
  .main-nav a[aria-current="page"] {
    color: var(--blue);
    border-left: 3px solid var(--gold);
    padding-left: .75rem;
  }
  .main-nav li:last-child a { border-bottom: none; }

  /* dropdowns collapse into inline accordions */
  .nav-parent {
    width: 100%; justify-content: space-between;
    padding: .8rem .5rem; border-bottom: 1px solid var(--line); border-radius: 0;
    color: var(--ink);
  }
  .nav-parent::after { display: none; }
  .has-dropdown.open .nav-parent .caret { transform: rotate(180deg); }
  .dropdown {
    position: static; min-width: 0; padding: 0;
    border: 0; border-radius: 0; box-shadow: none;
    opacity: 1; visibility: visible; transform: none;
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  /* desktop hover/focus reveal must not fire inside the collapsed panel */
  .has-dropdown:hover > .dropdown,
  .has-dropdown:focus-within > .dropdown { max-height: 0; }
  .has-dropdown.open > .dropdown { max-height: 360px; }
  .dropdown a {
    padding: .7rem .5rem .7rem 1.5rem;
    border-bottom: 1px solid var(--line); border-radius: 0;
    color: var(--muted);
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #e6f2ea;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(18,150,82,.45), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
}
.hero .container { position: relative; z-index: 2; padding-block: clamp(3.5rem, 9vw, 7rem); }
.hero h1 { color: #fff; max-width: 16ch; }
.hero p { font-size: 1.2rem; color: #c8e6d3; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.hero-art {
  position: absolute; inset: 0; z-index: -1; opacity: .5;
  pointer-events: none;
}
.hero-art svg { position: absolute; left: 74%; top: 45%; transform: translate(-50%, -50%); width: min(56%, 620px); height: auto; }
@media (max-width: 720px) {
  .hero-art { opacity: .18; }
  .hero-art svg { left: 50%; right: auto; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(85%, 340px); }
}

/* ---------- Stat band ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.stat { text-align: center; padding: 1rem; }
.stat .num { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; color: #fff; line-height: 1; }
.section:not(.section--navy) .stat .num { color: var(--navy); }
/* On the indigo band, alternate the two readable logo accents */
.section--navy .stat:nth-child(odd)  .num { color: var(--gold); }
.section--navy .stat:nth-child(even) .num { color: var(--yellow); }
.stat .lbl { font-size: .9rem; color: inherit; opacity: .85; margin-top: .4rem; min-height: 2.5rem; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-sm);
}
.card .icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: var(--sky); color: var(--blue); margin-bottom: 1rem;
}
.card .icon svg { width: 26px; height: 26px; }
.card .icon--gold   { background: #fbeacb; color: var(--gold-d); }
.card .icon--green  { background: #dcefe2; color: var(--green); }
.card .icon--yellow { background: #fbf3c2; color: #8a6d00; }
.card .icon--indigo { background: #e9e5f6; color: var(--indigo); }
.card h3 { margin-bottom: .35rem; }
.card p { color: var(--muted); margin: 0; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; gap: 1.25rem; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-left: 3.4rem; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--gold); color: #2a1c00; font-weight: 800;
  display: grid; place-items: center;
}
.step h3 { margin-bottom: .25rem; }
.step p { color: var(--muted); margin: 0; }

/* ---------- Green check lists ---------- */
.checklist { list-style: none; padding-left: 0; margin: 0 0 1.25rem; }
.checklist li { position: relative; padding-left: 2rem; margin-bottom: .55rem; color: var(--muted); }
.checklist li::before {
  content: "\2713"; position: absolute; left: 0; top: .05rem;
  width: 1.3rem; height: 1.3rem; border-radius: 50%;
  background: var(--green); color: #fff; font-size: .78rem; font-weight: 800;
  display: grid; place-items: center;
}
.checklist li strong { color: var(--ink); }

/* ---------- Split / audience ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.audience {
  border-radius: var(--radius); padding: 2rem; border: 1px solid var(--line);
  background: var(--bg); box-shadow: var(--shadow-sm);
}
.audience--pilot { background: linear-gradient(160deg, #fff, var(--sky)); }
.audience--patient { background: linear-gradient(160deg, #fff, #fff6e6); }
.audience h3 { font-size: 1.5rem; }
.audience ul { margin: 0 0 1.25rem; padding-left: 1.1rem; color: var(--muted); }
.audience li { margin-bottom: .35rem; }

/* ---------- CTA strip ---------- */
.cta {
  text-align: center;
  background: linear-gradient(120deg, var(--blue-d), var(--navy));
  color: #fff; border-radius: var(--radius); padding: clamp(2rem, 5vw, 3.2rem);
}
.cta h2 { color: #fff; }
.cta p { color: #d8ebdf; max-width: 52ch; margin-inline: auto; }
.cta .hero-actions { justify-content: center; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.info-row { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: 1.1rem; }
.info-row svg { width: 22px; height: 22px; color: var(--blue); flex: none; margin-top: .2rem; }
.info-row .l { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.info-row .v { font-weight: 600; color: var(--ink); }

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .92rem; }
.field input, .field textarea {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: #fff; transition: .15s;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,119,64,.22);
}
.req { color: #d6453a; }
.form-note { font-size: .85rem; color: var(--muted); }

/* ---------- Downloads ---------- */
.dl-card { display: flex; flex-direction: column; }
.dl-card .file-ico {
  width: 48px; height: 48px; border-radius: 11px; display: grid; place-items: center;
  background: var(--sky); color: var(--green); margin-bottom: .9rem;
}
.dl-card .file-ico svg { width: 25px; height: 25px; }
.dl-card h3 { margin-bottom: .3rem; }
.dl-card p { color: var(--muted); margin: 0 0 1rem; flex: 1 0 auto; }
.dl-meta {
  display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem;
  font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
}
.pdf-badge {
  background: #c0392b; color: #fff; font-weight: 700;
  border-radius: 5px; padding: .08rem .42rem; font-size: .7rem; letter-spacing: .02em;
}
.dl-card .btn { align-self: flex-start; }
.dl-alt { font-size: .82rem; margin: .6rem 0 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #b9cbe0; padding: 3rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; } }
.site-footer h4 { color: #fff; font-size: 1rem; margin: 0 0 .8rem; }
.site-footer a { color: #cfe0f3; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .45rem; }
.footer-brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 800; font-size: 1.15rem; margin-bottom: .6rem; }
.footer-brand svg { width: 28px; height: 28px; color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); margin-top: 2rem; padding-top: 1.25rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: .85rem; color: #91a7c2;
}
.badge {
  display: inline-block; padding: .25rem .6rem; border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; font-size: .78rem; color: #cfe0f3;
}

/* utilities */
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.muted { color: var(--muted); }
