/* ==========================================================================
   ClinicalMulti V1 — front-end stylesheet
   Mobile-first. --accent / --accent-dark are injected inline from settings.
   ========================================================================== */

:root {
  --accent: #0B5C8F;
  --accent-dark: #083F63;
  --ink: #10202B;
  --ink-soft: #4A5C68;
  --ink-faint: #7C8B96;
  --line: #E2E8ED;
  --line-soft: #EFF3F6;
  --bg: #F6F8FA;
  --card: #FFFFFF;
  --good: #12805C;
  --good-bg: #E8F5F0;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16, 32, 43, .06), 0 1px 3px rgba(16, 32, 43, .04);
  --shadow-md: 0 4px 14px rgba(16, 32, 43, .07), 0 1px 3px rgba(16, 32, 43, .05);
  --shadow-lg: 0 18px 44px rgba(16, 32, 43, .10), 0 2px 8px rgba(16, 32, 43, .05);
  --maxw: 720px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

h1, h2, h3 { margin: 0 0 .5em; line-height: 1.22; letter-spacing: -.018em; font-weight: 700; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

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

.site-header {
  background: #fff;
  border-bottom: 1px solid #D5DEE5;
  box-shadow: 0 1px 4px rgba(16, 32, 43, .05);
  padding: 13px 0;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  flex: none;
}

/* ---------- Main -------------------------------------------------------- */

.site-main { flex: 1 0 auto; padding: 34px 0 48px; }

@media (min-width: 700px) { .site-main { padding: 48px 0 64px; } }

/* ---------- Hero -------------------------------------------------------- */

.hero { text-align: center; margin-bottom: 26px; }

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(11, 92, 143, .08);
  padding: 6px 12px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(1.6rem, 5.2vw, 2.35rem);
  margin-bottom: 12px;
}

.hero .lede {
  font-size: clamp(1rem, 2.4vw, 1.125rem);
  color: var(--ink-soft);
  max-width: 34em;
  margin: 0 auto;
}

/* ---------- Card -------------------------------------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px 20px;
}

@media (min-width: 700px) { .card { padding: 34px 36px; } }

.card + .card { margin-top: 18px; }

.card h2 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -.005em;
  margin-bottom: 14px;
}

/* ---------- Check list -------------------------------------------------- */

.checks { list-style: none; margin: 0 0 22px; padding: 0; }
.checks:last-of-type { margin-bottom: 0; }

.checks li {
  position: relative;
  padding: 0 0 0 32px;
  margin-bottom: 11px;
  color: var(--ink-soft);
  font-size: .975rem;
}
.checks li:last-child { margin-bottom: 0; }

.checks li::before {
  content: '';
  position: absolute;
  left: 0; top: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--good-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2312805C' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/12px no-repeat;
}

.divider { height: 1px; background: var(--line-soft); margin: 22px 0; border: 0; }

/* ---------- Buttons ----------------------------------------------------- */

.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -.005em;
  padding: 16px 22px;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 2px 0 var(--accent-dark), var(--shadow-sm);
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--accent-dark); }
.btn:focus-visible { outline: 3px solid rgba(11, 92, 143, .35); outline-offset: 2px; }

.btn-ghost {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--line);
  box-shadow: none;
  font-size: .95rem;
  padding: 13px 20px;
}
.btn-ghost:hover { background: var(--line-soft); color: var(--accent-dark); }

.btn-sm { width: auto; display: inline-block; padding: 11px 20px; font-size: .95rem; }

.reassure {
  text-align: center;
  font-size: .875rem;
  color: var(--ink-faint);
  margin: 14px 0 0;
}

/* ---------- Trust bar --------------------------------------------------- */

.trustbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}
.trustbar li {
  font-size: .8125rem;
  color: var(--ink-faint);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
}
.trustbar svg { flex: none; color: var(--good); }

/* ---------- Progress ---------------------------------------------------- */

.progress {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin: 0 0 26px;
}
.progress span {
  height: 5px;
  width: 42px;
  border-radius: 100px;
  background: var(--line);
}
.progress span.on { background: var(--accent); }

/* ---------- Form -------------------------------------------------------- */

.field { margin-bottom: 22px; }
.field:last-of-type { margin-bottom: 0; }

.field > label,
.field .label {
  display: block;
  font-weight: 600;
  font-size: .975rem;
  margin-bottom: 4px;
  color: var(--ink);
}

.hint { font-size: .8125rem; color: var(--ink-faint); margin: 0 0 10px; }

input[type=text],
input[type=tel],
input[type=password],
input[type=url],
input[type=number],
input[type=email],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* prevents iOS zoom */
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 13px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}

textarea { line-height: 1.5; resize: vertical; min-height: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 92, 143, .13);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A5C68' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 38px;
}

.dob-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1.1fr;
  gap: 8px;
}

.zip-field { max-width: 190px; letter-spacing: .12em; font-weight: 600; }

/* Segmented gender control */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.seg input { position: absolute; opacity: 0; pointer-events: none; }

.seg label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fff;
  font-weight: 600;
  font-size: .975rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}
.seg label:hover { border-color: #C9D5DE; }

.seg input:checked + label {
  border-color: var(--accent);
  background: rgba(11, 92, 143, .06);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.seg input:focus-visible + label { outline: 3px solid rgba(11, 92, 143, .3); outline-offset: 2px; }

.form-error {
  background: #FDECEC;
  border: 1px solid #F5C6C6;
  color: #9B1C1C;
  border-radius: 11px;
  padding: 12px 14px;
  font-size: .9rem;
  margin-bottom: 20px;
}

.privacy-note {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: .8125rem;
  color: var(--ink-faint);
  margin-top: 16px;
}
.privacy-note svg { flex: none; margin-top: 2px; }

/* ---------- Steps (single-page funnel) ---------------------------------- */

.step[hidden] { display: none !important; }

.step-in { animation: stepIn .22s ease both; }

@keyframes stepIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* Spinner inside the submit button */
.spinner { display: none; width: 17px; height: 17px; margin-left: 9px; }
.btn.is-loading .spinner {
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: -3px;
}
.btn.is-loading { opacity: .85; cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }

#qsubmit { display: flex; align-items: center; justify-content: center; }

/* ---------- Results ----------------------------------------------------- */

.results-hero { margin-bottom: 22px; }

.results-title {
  font-size: clamp(1.3rem, 4.2vw, 1.75rem);
  margin: 0 0 10px;
  letter-spacing: -.018em;
}

.results-sub {
  font-size: clamp(.9rem, 2.1vw, 1rem);
  color: var(--ink-soft);
  max-width: 32em;
  margin: 0 auto;
}

.study-list { display: grid; gap: 14px; }

.study {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease;
}
.study:hover { box-shadow: var(--shadow-md); border-color: #CFDCE5; }

.study h3 { font-size: 1.125rem; margin-bottom: 6px; }

.study .cond { font-size: .8125rem; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }

.study p { color: var(--ink-soft); font-size: .9375rem; }

.study-req {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  background: #FFF8E8;
  border: 1px solid #F5E4BC;
  color: #7A5A10;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .875rem;
  margin: 12px 0 0;
}
.study-req svg { flex: none; margin-top: 2px; }

.study-meta { font-size: .8125rem; color: var(--ink-faint); margin-top: 10px; }

.study-actions { margin-top: 16px; }

.study-actions .btn { display: flex; align-items: center; justify-content: center; gap: 8px; }

.no-match { text-align: center; }
.no-match .icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--line-soft);
  color: var(--ink-faint);
}
.nomatch-title { font-size: 1.3rem; margin-bottom: 10px; }
.nomatch-body { color: var(--ink-soft); font-size: .95rem; }

.back-link {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  font: inherit;
  text-align: center;
  margin-top: 22px;
  padding: 6px;
  font-size: .9rem;
  color: var(--ink-faint);
  cursor: pointer;
}
.back-link:hover { color: var(--accent); text-decoration: none; }

/* ---------- Legal / content pages --------------------------------------- */

.legal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 26px 20px 30px;
}

@media (min-width: 700px) { .legal { padding: 40px 44px 44px; } }

.legal h1 { font-size: clamp(1.5rem, 4.4vw, 2rem); margin-bottom: 6px; }

.legal-updated {
  font-size: .8125rem;
  color: var(--ink-faint);
  margin-bottom: 26px;
}

.legal-lead {
  font-size: 1.03rem;
  color: var(--ink-soft);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 24px;
}

.legal h2 {
  font-size: 1.0625rem;
  margin: 30px 0 10px;
  padding-top: 4px;
}
.legal h2:first-of-type { margin-top: 0; }

.legal h3 {
  font-size: .95rem;
  font-weight: 600;
  margin: 22px 0 6px;
}

.legal p, .legal li { color: var(--ink-soft); font-size: .9375rem; }

.legal ul { padding-left: 20px; margin: 0 0 16px; }
.legal li { margin-bottom: 7px; }
.legal li::marker { color: var(--ink-faint); }

.legal strong { color: var(--ink); font-weight: 600; }

.legal-callout {
  background: #F4F8FB;
  border: 1px solid #D8E5EE;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 18px 0 20px;
}
.legal-callout p:last-child { margin-bottom: 0; }

.legal-note {
  font-size: .875rem;
  color: var(--ink-faint);
}

.legal-contact { font-size: .9rem; }

.contact-email {
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  margin: 6px 0 4px;
  word-break: break-word;
}
.contact-email a { color: var(--accent); }

.legal + .back-link { margin-bottom: 6px; }

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

.site-footer {
  flex: none;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 26px 0 32px;
  text-align: center;
}

.footer-links { font-size: .875rem; margin-bottom: 12px; }
.footer-links a { color: var(--accent); }
.footer-links .sep { color: var(--line); margin: 0 8px; }

.disclaimer, .copyright {
  font-size: .75rem;
  color: var(--ink-faint);
  max-width: 46em;
  margin: 0 auto 8px;
  line-height: 1.5;
}
.copyright { margin-bottom: 0; }

/* ---------- Utilities --------------------------------------------------- */

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
