/*
  MyCareRoster.com — one stylesheet for every page.
  Colours come straight from the app (MyCareRosterApp/CareDesignSystem.swift, CarePalette):
    background #0A1729, backgroundHighlight #123B45, surface #1A2E40,
    featured #215763, secondary text #D4E8F0, accent #99EDF2, destructive #FF8C85.
  Dark only, like the app. System fonts only. No external resources.
*/

:root {
  --bg: #0a1729;
  --bg-highlight: #123b45;
  --surface: #1a2e40;
  --featured: #215763;
  --text: #ffffff;
  --text-2: #d4e8f0;
  --text-3: #9fb4c0;
  --accent: #99edf2;
  --accent-soft: rgba(153, 237, 242, 0.16);
  --on-accent: #0a1729;
  --hairline: rgba(255, 255, 255, 0.10);

  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 72rem;
  --gutter: clamp(1.1rem, 4vw, 2rem);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);

  color-scheme: dark;
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.125rem;            /* 18px base: the audience is often older */
  line-height: 1.6;
  color: var(--text-2);
  /* The app's backdrop: a diagonal gradient from highlight to background. */
  background:
    linear-gradient(160deg, var(--bg-highlight) 0%, var(--bg) 38rem) no-repeat,
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

main { flex: 1 0 auto; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3, h4 {
  color: var(--text);
  line-height: 1.15;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 1.5rem + 2.8vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.3rem); font-weight: 750; }
h3 { font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem); font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 700; }

p, ul, ol { margin: 0 0 1em; }
li + li { margin-top: 0.35em; }
strong { color: var(--text); }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-left: calc(var(--gutter) + env(safe-area-inset-left));
  padding-right: calc(var(--gutter) + env(safe-area-inset-right));
}
.container.narrow { max-width: 46rem; }

/* Small uppercase label, like the app's "FAMILY MEMBER" / "CARE TEAM" headers. */
.eyebrow {
  display: block;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.6rem;
}

.lead { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem); color: var(--text-2); }
.muted { color: var(--text-3); }
.small { font-size: 0.95rem; }

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -10rem;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--hairline);
  padding-top: env(safe-area-inset-top);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-block: 0.9rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-weight: 750;
  font-size: 1.2rem;
  text-decoration: none;
}
.brand img {
  width: 40px;
  height: 40px;
  border-radius: 22%;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav li + li { margin-top: 0; }
.site-nav a {
  display: inline-block;
  color: var(--text-2);
  font-weight: 600;
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
}
.site-nav a:hover { color: var(--text); background: var(--accent-soft); }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* ---------- Buttons and store link ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  background: var(--accent);
  color: var(--on-accent);
  border: 2px solid var(--accent);
}
.button:hover { background: #b8f4f7; border-color: #b8f4f7; }
.button.secondary {
  background: transparent;
  color: var(--accent);
}
.button.secondary:hover { background: var(--accent-soft); }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1rem;
  margin: 1.6rem 0 0.8rem;
}

/* Apple's badge, once added: keep at least 40px tall and clear space of a quarter of its height. */
.store-badge img { height: 54px; width: auto; }
.store-badge { display: inline-block; padding: 0; line-height: 0; }

/* ---------- Device frames (generic, no device details) ---------- */

.shot {
  margin: 0;
  justify-self: center;
}
.shot img {
  border-radius: 2.1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow);
  background: var(--bg);
}
.shot.phone { width: min(100%, 19rem); }
.shot.phone.small { width: min(100%, 16rem); }
.shot.tablet { width: 100%; }
.shot.tablet img { border-radius: 1.4rem; }
.shot figcaption {
  margin-top: 0.9rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-3);
}

/* ---------- Home ---------- */

.hero { padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(2rem, 6vw, 4.5rem); }
.hero-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 span { display: block; }
.hero .note { margin-top: 0.4rem; }

.section { padding-block: clamp(2.5rem, 7vw, 5rem); }
.section + .section { border-top: 1px solid var(--hairline); }
.section-head { max-width: 44rem; margin-bottom: 2.2rem; }

.feature {
  display: grid;
  gap: clamp(1.8rem, 5vw, 4rem);
  align-items: center;
}
.feature + .feature { margin-top: clamp(3rem, 8vw, 5.5rem); }
.feature-text { max-width: 34rem; }

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
}
.cards > li { margin: 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
}
.card h3 { margin-bottom: 0.4em; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card.featured { background: var(--featured); border-color: rgba(153, 237, 242, 0.35); }

.ticks { list-style: none; padding: 0; }
.ticks li { position: relative; padding-left: 1.7rem; }
.ticks li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.55em;
  width: 0.65rem;
  height: 0.35rem;
  border-left: 2.5px solid var(--accent);
  border-bottom: 2.5px solid var(--accent);
  transform: rotate(-45deg);
}

.pricing {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
}
.pricing .card { padding: 1.8rem; }
.price-label { font-size: 1.6rem; font-weight: 800; color: var(--text); margin-bottom: 0.2rem; }

.closing { text-align: center; }
.closing .actions { justify-content: center; }

.disclaimer {
  font-size: 0.95rem;
  color: var(--text-3);
  text-align: center;
  max-width: 40rem;
  margin: 0 auto;
}

/* ---------- Document pages (Guide, Support, Privacy) ---------- */

.page-head { padding-block: clamp(2.2rem, 6vw, 4rem) 1.5rem; }
.page-head h1 { margin-bottom: 0.3em; }
.meta { color: var(--text-3); font-size: 0.95rem; }

.doc { padding-bottom: clamp(3rem, 8vw, 5rem); }
.doc h2 {
  font-size: clamp(1.45rem, 1.25rem + 0.9vw, 1.9rem);
  margin-top: 2.6rem;
  padding-top: 0.4rem;
}
.doc h3 { margin-top: 1.8rem; }
.doc h2:first-child, .doc h3:first-child { margin-top: 0; }
.doc ul, .doc ol { padding-left: 1.4rem; }
.doc section { scroll-margin-top: 1rem; }
.doc .shot { margin: 1.6rem auto; }

.summary-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  margin: 1.4rem 0 2rem;
}
.summary-card ul { margin-bottom: 0; }

.tip {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin: 1.2rem 0;
}
.tip p:last-child { margin-bottom: 0; }

/* Labels as they appear in the app. */
.ui {
  color: var(--text);
  font-weight: 650;
}

/* Guide layout: table of contents beside the text on wide screens. */
.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}
.toc {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  align-self: start;
}
.toc h2 {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6rem;
  padding: 0;
}
.toc ol { margin: 0; padding-left: 1.3rem; }
.toc li + li { margin-top: 0.15em; }
.toc li { padding: 0.15rem 0; line-height: 1.35; }
.toc a { color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

.back-to-top { margin-top: 2.2rem; font-size: 0.95rem; }

/* FAQ */
.faq {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 0.3rem 1.4rem;
  margin: 1.2rem 0 2rem;
}
.faq details { border-bottom: 1px solid var(--hairline); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  cursor: pointer;
  list-style: none;
  color: var(--text);
  font-weight: 650;
  padding: 1rem 2rem 1rem 0;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 0.3rem;
  top: 1.35rem;
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2.5px solid var(--accent);
  border-bottom: 2.5px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 1.6rem; }
.faq details > :not(summary) { margin-top: 0; }
.faq details p:last-child { padding-bottom: 0.6rem; }

.contact-block { margin: 1.6rem 0 2.4rem; }
.contact-block .meta { margin-top: 0.8rem; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  background: rgba(0, 0, 0, 0.18);
  padding-block: 2rem calc(2rem + env(safe-area-inset-bottom));
  font-size: 0.95rem;
  color: var(--text-3);
}
.footer-grid {
  display: grid;
  gap: 1.2rem;
}
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-nav li + li { margin-top: 0; }
.footer-nav a { color: var(--text-2); }
.site-footer p { margin: 0; }
.legal { font-size: 0.85rem; }

/* ---------- Wider screens ---------- */

@media (min-width: 52rem) {
  .hero-grid { grid-template-columns: 1.25fr 1fr; }
  .feature { grid-template-columns: 1fr 1fr; }
  .feature.flip .feature-text { order: 2; }
  .guide-layout { grid-template-columns: 15rem minmax(0, 1fr); gap: 3rem; }
  .toc { position: sticky; top: 1.2rem; max-height: calc(100vh - 2.4rem); overflow-y: auto; }
  .footer-grid { grid-template-columns: 1fr auto; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .toc, .actions, .skip-link { display: none; }
  h1, h2, h3, h4, strong, .ui { color: #000; }
  a { color: #000; }
  .card, .summary-card, .faq, .tip { background: none; border: 1px solid #999; }
}
