/* EchoAssure: one stylesheet, system fonts, light by default, dark via prefers-color-scheme. */

:root {
  --bg: #f6f8f9;
  --surface: #ffffff;
  --surface-alt: #eef4f5;
  --text: #13222a;
  --muted: #475860;
  --border: #d3dde1;
  --border-strong: #7d8f97;
  --accent: #0b5f68;
  --accent-hover: #084b52;
  --accent-soft: #e3f0f1;
  --on-accent: #ffffff;
  --focus: #0b5f68;
  --error: #b02a1e;
  --error-soft: #fbeceb;
  --success: #1b6a39;
  --success-soft: #e8f4ec;
  --motif: #0b5f68;

  --radius: 10px;
  --max: 68rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c161b;
    --surface: #122027;
    --surface-alt: #0f1c22;
    --text: #e4edf0;
    --muted: #a6b6bd;
    --border: #273a43;
    --border-strong: #6f858f;
    --accent: #5cc4cc;
    --accent-hover: #86d6dc;
    --accent-soft: #143238;
    --on-accent: #062a2e;
    --focus: #86d6dc;
    --error: #ff9b91;
    --error-soft: #3a1c1a;
    --success: #86d9a2;
    --success-soft: #15301f;
    --motif: #5cc4cc;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img, svg { max-width: 100%; }

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

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

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.6em; }
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 650; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--accent); color: var(--on-accent);
  padding: 0.6rem 1rem; border-radius: var(--radius); font-weight: 600;
}
.skip-link:focus { top: 1rem; color: var(--on-accent); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 4rem; }
.site-header .btn { flex: none; }
.brand { flex: none; display: inline-flex; align-items: center; gap: 0.55rem; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand .mark-sector { fill: var(--accent); }
.brand .mark-arc { stroke: var(--surface); }
.brand span b { color: var(--accent); font-weight: 700; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.9rem; padding: 0.65rem 1.25rem;
  border-radius: var(--radius); border: 2px solid var(--accent);
  background: var(--accent); color: var(--on-accent);
  font: inherit; font-weight: 650; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: transparent; color: var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); color: var(--accent-hover); border-color: var(--accent-hover); }
.btn-small { min-height: 2.5rem; padding: 0.4rem 0.9rem; font-size: 0.925rem; border-radius: 8px; }
.btn[disabled] { opacity: 0.65; cursor: progress; }

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--surface); border-bottom: 1px solid var(--border); }
.hero .wrap { position: relative; padding-top: clamp(3rem, 8vw, 6rem); padding-bottom: clamp(3rem, 8vw, 6rem); }
.hero-text { max-width: 40rem; position: relative; z-index: 1; }
.eyebrow {
  display: inline-block; margin: 0 0 1.25rem; padding: 0.3rem 0.75rem;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--accent-soft); color: var(--text);
  font-size: 0.875rem; font-weight: 600;
}
.lede { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem); color: var(--muted); max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.hero-note { margin-top: 1.25rem; font-size: 0.95rem; color: var(--muted); }
.hero-motif {
  position: absolute; right: -6rem; top: 50%; transform: translateY(-50%);
  width: min(38rem, 70vw); color: var(--motif); opacity: 0.16; pointer-events: none;
}
@media (max-width: 47.99rem) {
  .hero-motif { right: -10rem; top: auto; bottom: -9rem; transform: none; width: 26rem; opacity: 0.1; }
}

/* Sections */
section { scroll-margin-top: 1rem; }
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-alt { background: var(--surface-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-intro { max-width: 42rem; color: var(--muted); }
.section-head { max-width: 42rem; margin-bottom: 2rem; }

.problem-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.problem-list li { padding: 1.25rem 1.25rem 1.25rem 1.4rem; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }
.problem-list p { margin: 0; color: var(--muted); }
.problem-list strong { display: block; color: var(--text); margin-bottom: 0.3rem; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; }
.card h3 { display: flex; gap: 0.6rem; align-items: baseline; }
.card .num { flex: none; font-size: 0.8rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.card p { margin: 0; color: var(--muted); }
.cards-note { margin-top: 1.5rem; font-size: 0.95rem; color: var(--muted); max-width: 42rem; }

.principles { display: grid; gap: 1.5rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); margin: 0; }
.principles div { padding-top: 1rem; border-top: 2px solid var(--border); }
.principles dt { font-weight: 650; margin-bottom: 0.35rem; }
.principles dd { margin: 0; color: var(--muted); }

.people { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.person { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; }
.person p:last-child { margin: 0; color: var(--muted); }
.person .role { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.4rem; }

/* Register form */
.register-grid { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 60rem) { .register-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); } }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); }

.field { margin-bottom: 1.35rem; }
.field > label, fieldset > legend { display: block; font-weight: 650; margin-bottom: 0.35rem; }
.req { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.hint { display: block; color: var(--muted); font-size: 0.92rem; margin: -0.15rem 0 0.45rem; }

input[type="text"], input[type="email"], select, textarea {
  width: 100%; min-height: 2.9rem; padding: 0.6rem 0.75rem;
  font: inherit; color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border-strong); border-radius: 8px;
}
textarea { min-height: 7rem; resize: vertical; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 1.3rem, calc(100% - 0.8rem) 1.3rem;
  background-size: 0.35rem 0.35rem; background-repeat: no-repeat;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
[aria-invalid="true"] { border-color: var(--error) !important; }

fieldset { border: 0; padding: 0; margin: 0 0 1.35rem; min-width: 0; }
.checks { display: grid; gap: 0.35rem; }
.check { display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.35rem 0; cursor: pointer; }
.check input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0.18rem 0 0; accent-color: var(--accent); cursor: pointer; }
.consent { padding: 1rem; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 8px; }
.consent.is-invalid { border-color: var(--error); }

.field-error { display: block; color: var(--error); font-weight: 600; font-size: 0.95rem; margin-top: 0.35rem; }
.field-error:empty { display: none; }
.counter { display: block; text-align: right; color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }

.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.turnstile-wrap { margin: 0 0 1.35rem; min-height: 65px; }

.alert { border-radius: 8px; padding: 1rem 1.1rem; margin-bottom: 1.35rem; border: 1.5px solid; }
.alert:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.alert h3 { margin-bottom: 0.35rem; font-size: 1.05rem; }
.alert p:last-child, .alert ul:last-child { margin-bottom: 0; }
.alert ul { margin: 0.25rem 0 0; padding-left: 1.2rem; }
.alert-error { background: var(--error-soft); border-color: var(--error); }
.alert-error a { color: var(--text); }
.alert-success { background: var(--success-soft); border-color: var(--success); }
.alert-success h3 { color: var(--success); }

.form-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.form-footer p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* FAQ */
.faq { max-width: 46rem; }
.faq details { border-top: 1px solid var(--border); }
.faq details:last-child { border-bottom: 1px solid var(--border); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.1rem 2.25rem 1.1rem 0; position: relative;
  font-weight: 650;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 0.4rem; top: 1.45rem; width: 0.55rem; height: 0.55rem;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(45deg);
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 1.7rem; }
.faq details > div { padding: 0 0 1.1rem; color: var(--muted); }
.faq details > div p:last-child { margin: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 2rem 0; font-size: 0.95rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; justify-content: space-between; }
.site-footer p { margin: 0; }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; padding: 0; }
.disclaimer { flex-basis: 100%; font-size: 0.88rem; }

/* Prose pages (privacy, 404) */
.prose { max-width: 44rem; padding: clamp(2.5rem, 6vw, 4rem) 0; }
.prose h2 { font-size: 1.35rem; margin-top: 2.2rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.4rem; }
.prose .updated { color: var(--muted); }
.table-scroll { overflow-x: auto; margin-bottom: 1rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border: 1px solid var(--border); }
.prose th { background: var(--surface-alt); }

/* Phones: 16px gutters, a compact header, and full-width stacked actions. */
@media (max-width: 30rem) {
  .wrap { padding: 0 1rem; }
  .site-header .wrap { min-height: 3.5rem; }
  .brand { font-size: 1.1rem; gap: 0.45rem; }
  .brand svg { width: 26px; height: 26px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .form-footer { flex-direction: column; align-items: stretch; text-align: center; gap: 0.75rem; }
  .form-footer .btn { width: 100%; }
  .form-card { padding: 1.25rem 1rem; }
}
