/* ─────────────────────────────────────────────────────────────
   EndoAI — shared styles for Privacy, Terms and Support pages.
   Mirrors the locked homepage design system (warm ivory / forest
   green / pale sage, Fraunces + Inter). No build step; linked
   directly. The homepage keeps its own inline styles, untouched.
   ───────────────────────────────────────────────────────────── */

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

:root {
  --forest: #0B4D2B;
  --forest-deep: #083C22;
  --sage: #98AA88;
  --sage-wash: #EDF2EA;
  --canvas: #FAF6F1;
  --surface: #FFFEFA;
  --white: #FFFFFF;
  --wash: #F1ECE2;
  --border: #E3E8DD;
  --line: rgba(24, 49, 40, 0.12);
  --ink: #183128;
  --ink-soft: #3B4F44;
  --ink-mute: #5A6B60;
  --shadow: 0 30px 60px -38px rgba(11, 77, 43, 0.35);
  --shadow-soft: 0 16px 36px -28px rgba(11, 77, 43, 0.28);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-size: 15px;
}
h1, h2 { font-family: "Fraunces", Georgia, serif; font-weight: 500; line-height: 1.12; letter-spacing: -0.02em; color: var(--ink); }
h3 { font-family: "Inter", system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container { width: min(1080px, calc(100% - 48px)); margin: 0 auto; }

/* ── Accessibility: skip link + focus ── */
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 12px 18px; border-radius: 12px; background: var(--forest); color: var(--canvas); font-size: 14px; font-weight: 600; transition: top 160ms ease; }
.skip-link:focus-visible { top: 14px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid rgba(11, 77, 43, 0.5); outline-offset: 3px; border-radius: 8px; }

/* ── Navigation — static frosted bar (same language as homepage, no scroll JS) ── */
.site-nav { position: sticky; top: 0; z-index: 40; background: rgba(250, 246, 241, 0.88); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 30px; height: 30px; border-radius: 9px; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.brand-name b { color: var(--forest); font-weight: 700; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 9px 13px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--ink); transition: background 160ms var(--ease), color 160ms var(--ease); }
.nav-links a:not(.button):hover { background: var(--sage-wash); color: var(--forest); }
.nav-links a[aria-current="page"] { color: var(--forest); font-weight: 600; background: var(--sage-wash); }
@media (max-width: 760px) {
  .container { width: min(100% - 32px, 1080px); }
  .nav-links a:not(.button) { display: none; }
}
@media (max-width: 359px) {
  .brand-name { display: none; }
  .nav-links .button { padding: 0 14px; font-size: 13px; }
  .contact-cta { padding: 32px 18px; }
  .contact-cta .button { padding: 0 14px; font-size: 13px; overflow-wrap: anywhere; }
}

/* ── Buttons — matching homepage radii and behaviour ── */
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 20px; border-radius: 14px; font-size: 14px; font-weight: 600; transition: transform 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease); }
.button:hover { transform: translateY(-2px); }
.button-primary { color: var(--white); background: var(--forest); box-shadow: 0 16px 30px -20px rgba(11, 77, 43, 0.55); }
.button-primary:hover { background: var(--forest-deep); }
.button:focus-visible { border-radius: 14px; }
.nav-links .button { margin-left: 8px; color: var(--white); }
.nav-links .button:hover { background: var(--forest-deep); }

/* ── Page hero — calm editorial header ── */
.page-hero { padding: 72px 0 52px; background: linear-gradient(160deg, var(--sage-wash) 0%, var(--canvas) 58%); border-bottom: 1px solid var(--line); }
.eyebrow { font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--forest); font-weight: 700; }
.page-hero h1 { font-size: clamp(34px, 5vw, 52px); margin: 14px 0 10px; }
.page-hero h1 em { font-style: italic; color: var(--forest); }
.page-hero-sub { color: var(--ink-soft); font-size: 16px; line-height: 1.7; max-width: 56ch; }
.updated-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-soft); font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.updated-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sage); flex: none; }

/* Restrained page-load reveal (CSS only; killed under reduced motion) */
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.page-hero .container > * { animation: page-in 600ms var(--ease) both; }
.page-hero .container > *:nth-child(2) { animation-delay: 80ms; }
.page-hero .container > *:nth-child(3) { animation-delay: 150ms; }
.page-hero .container > *:nth-child(4) { animation-delay: 220ms; }

/* ── Legal layout: sticky TOC + readable column ── */
.legal-layout { display: grid; gap: 48px; padding: 56px 0 88px; }
.legal-toc { display: none; }
.legal-toc strong { display: block; margin-bottom: 14px; color: var(--ink-mute); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; }
.legal-toc a { display: block; padding: 7px 0 7px 14px; font-size: 13px; line-height: 1.45; color: var(--ink-soft); border-left: 2px solid var(--border); transition: color 160ms var(--ease), border-color 160ms var(--ease); }
.legal-toc a:hover { color: var(--forest); border-left-color: var(--sage); }
@media (min-width: 1020px) {
  .legal-layout { grid-template-columns: 216px 1fr; gap: 72px; }
  .legal-toc { display: block; position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; }
}

/* ── Legal content typography ── */
.legal-content { max-width: 680px; min-width: 0; }
.legal-content section { scroll-margin-top: 92px; }
.legal-content h2 { font-weight: 600; font-size: 24px; letter-spacing: -0.01em; margin: 48px 0 14px; padding-top: 26px; border-top: 1px solid var(--line); }
.legal-content section:first-of-type h2 { margin-top: 0; padding-top: 0; border-top: none; }
.legal-content h3 { font-size: 16.5px; font-weight: 700; color: var(--ink); margin: 28px 0 10px; }
.legal-content p { font-size: 15px; line-height: 1.75; color: var(--ink-soft); margin-bottom: 14px; }
.legal-content ul, .legal-content ol { margin: 10px 0 18px 22px; color: var(--ink-soft); font-size: 15px; line-height: 1.7; }
.legal-content li { margin-bottom: 8px; }
.legal-content li::marker { color: var(--sage); font-weight: 700; }
.legal-content strong { color: var(--ink); font-weight: 600; }
.legal-content a { color: var(--forest); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(11, 77, 43, 0.3); text-underline-offset: 3px; transition: text-decoration-color 160ms var(--ease); }
.legal-content a:hover { text-decoration-color: var(--forest); }

/* Callout — replaces the old plum "important box" */
.callout { background: var(--sage-wash); border: 1px solid rgba(11, 77, 43, 0.08); border-left: 4px solid var(--forest); border-radius: 14px; padding: 20px 24px; margin: 24px 0; }
.callout p { color: var(--ink); font-weight: 500; margin-bottom: 0; }

/* ── Support page: contact cards, FAQ, CTA, disclaimer ── */
.lead { font-size: 16px; line-height: 1.7; color: var(--ink-soft); max-width: 60ch; }
.contact-cards { display: grid; gap: 14px; margin: 28px 0 8px; }
@media (min-width: 640px) { .contact-cards { grid-template-columns: 1fr 1fr; } }
.contact-card { padding: 22px 24px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-soft); transition: transform 240ms var(--ease), box-shadow 240ms var(--ease); min-width: 0; }
.contact-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.contact-card strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.contact-card a { color: var(--forest); font-weight: 600; font-size: 14px; text-decoration: underline; text-decoration-color: rgba(11, 77, 43, 0.3); text-underline-offset: 3px; overflow-wrap: anywhere; }
.contact-card a:hover { text-decoration-color: var(--forest); }

.faq-section { margin-top: 48px; }
.faq-section > h2 { font-weight: 600; font-size: 24px; letter-spacing: -0.01em; margin-bottom: 8px; }
.faq-list { display: grid; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; padding: 20px 4px; font-size: 16px; font-weight: 600; color: var(--ink); transition: color 160ms var(--ease); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { content: ""; }
.faq-item summary::after { content: "+"; flex: none; font-size: 20px; line-height: 1; font-weight: 500; color: var(--forest); transition: transform 240ms var(--ease); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--forest); }
.faq-body { padding: 0 4px 22px; max-width: 62ch; }
.faq-body p { margin: 0; font-size: 15px; line-height: 1.75; color: var(--ink-soft); }
.faq-body a { color: var(--forest); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(11, 77, 43, 0.3); text-underline-offset: 3px; }

.contact-cta { margin-top: 52px; padding: 40px 32px; border-radius: 24px; background: linear-gradient(135deg, var(--sage-wash), var(--canvas)); border: 1px solid var(--border); text-align: center; }
.contact-cta h2 { font-size: 24px; margin-bottom: 8px; }
.contact-cta p { color: var(--ink-soft); font-size: 15px; margin-bottom: 20px; }

.disclaimer { margin-top: 44px; padding: 20px 24px; border-radius: 16px; background: var(--sage-wash); border: 1px solid rgba(11, 77, 43, 0.08); font-size: 13.5px; color: var(--ink-soft); line-height: 1.65; }
.disclaimer strong { color: var(--ink); }

/* ── Footer — same language as homepage ── */
footer { padding: 64px 0 36px; background: var(--wash); border-top: 1px solid var(--line); }
.footer-main { display: grid; gap: 40px; }
.footer-brand { display: grid; gap: 14px; }
.footer-brand-mark { display: flex; align-items: center; gap: 10px; }
.footer-brand-mark img { width: 28px; height: 28px; border-radius: 8px; }
.footer-brand-mark span { font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.footer-brand-mark b { color: var(--forest); }
.footer-brand p { max-width: 380px; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.footer-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 32px; }
.footer-col strong { display: block; margin-bottom: 14px; color: var(--ink-mute); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; }
.footer-col a { display: block; margin-bottom: 10px; color: var(--ink-soft); font-size: 13.5px; transition: color 160ms ease; }
.footer-col a:hover { color: var(--forest); }
.footer-bottom { display: grid; gap: 12px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); }
.footer-bottom p { color: var(--ink-mute); font-size: 12px; line-height: 1.6; }
.footer-bottom p:first-child { max-width: 720px; }
.footer-bottom-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
@media (min-width: 880px) {
  .footer-main { grid-template-columns: 1.2fr 2fr; gap: 60px; }
  .footer-bottom-row { flex-direction: row; }
}

/* ── Reduced motion: everything visible in its final state ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .page-hero .container > * { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
