/* SmileTelligence patient flow (intake, progress, results, legal), styled to the brand guide v1.0.
   Strict CSP: no inline styles, no external assets.
   Every practice gets this same look. A practice changes only its name or logo in the header and its accent colour,
   which /b/{slug}/accent.css sets after this file (--accent, --accent-ink, --on-accent). */

:root {
  --navy: #082a3e;                   /* Deep Navy: header, primary buttons, call-to-action panel */
  --teal: #2db7a8;                   /* Teal: the default accent */
  --seafoam: #7ed5cb;                /* Seafoam: reverse accent on navy */
  --page: #f7faf9;                   /* Off White */
  --line: #d7e5e2;
  --mist: #eaf4f2;                   /* Mist */
  --slate: #5f7885;                  /* Slate: supporting borders and marks */
  --slate-ink: #4b6371;              /* Slate darkened for supporting text */
  --white: #ffffff;
  --ok: #2f7d5b;
  --warn: #9a4b14;

  /* The practice's accent. Defaults are the brand teal; accent.css replaces them. */
  --accent: #2db7a8;
  --accent-ink: #0e7c72;             /* the accent darkened until it reads as small text on the page */
  --on-accent: #082a3e;              /* text on a solid accent background */

  --display: "Inter Display", "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.1rem;
  --step-4: 2.75rem;

  --radius: 1rem;
  --radius-sm: 0.6rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--navy);
  font: 400 var(--step-0)/1.55 var(--sans);
}
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--navy); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.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;
}

/* ---- type ------------------------------------------------------------------------------------ */

h1, h2, .h1, .h2 { font-family: var(--display); font-weight: 500; letter-spacing: -0.02em; margin: 0; }
h1, .h1 { font-size: var(--step-4); line-height: 1.08; }
h2, .h2 { font-size: var(--step-3); line-height: 1.1; }
h3 { font-size: var(--step-1); font-weight: 600; line-height: 1.3; margin: 0; }
p { margin: 0; }
.lede { font-size: var(--step-1); line-height: 1.45; color: var(--slate-ink); max-width: 34em; }
.muted { color: var(--slate-ink); }
.small { font-size: var(--step--1); }

/* ---- frame ----------------------------------------------------------------------------------- */

.bar {
  display: flex; align-items: center; justify-content: space-between; min-height: 4.25rem;
  padding: 0.75rem clamp(1rem, 4vw, 2.5rem);
  background: var(--navy);
}
.brand { display: block; font: 600 1.375rem/1.2 var(--display); letter-spacing: -0.01em; color: var(--white); text-decoration: none; }
/* A practice logo can be any colours, so it sits on a white tile rather than straight on the navy. */
.brand-logo { max-height: 2.25rem; width: auto; padding: 0.3rem 0.6rem; box-sizing: content-box; background: var(--white); border-radius: 0.5rem; }
/* Patients see the practice's name or logo, with a small "powered by" line for the platform. */
.powered { font-size: 0.75rem; letter-spacing: 0.02em; color: var(--seafoam); text-align: right; }
.bar { gap: 0.75rem; }

main { width: 100%; margin: 0 auto; padding: clamp(1.5rem, 5vw, 3.5rem) 1rem 3rem; }
.intake { max-width: 40rem; }
/* The working surfaces of the flow sit on a card, so the page reads as a guided journey rather than a bare form. */
.intake form, .intake .processing, .intake .notice {
  padding: clamp(1.25rem, 4vw, 2rem); background: var(--white); border: 1px solid var(--line); border-radius: 1.25rem;
  box-shadow: 0 1rem 2.5rem -1.75rem rgb(8 42 62 / 0.35);
}
.eyebrow { display: block; margin-bottom: 0.25rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-ink); }
.results { max-width: 68rem; }

main.intake + .foot { text-align: center; } /* the narrow intake column sits in the middle, so its footer does too */
.foot {
  max-width: 68rem; margin: 0 auto; padding: 1.5rem 1rem 2.5rem;
  border-top: 1px solid var(--line); color: var(--slate-ink); font-size: var(--step--1);
}

/* ---- buttons --------------------------------------------------------------------------------- */

.btn {
  appearance: none; border: 1px solid transparent; border-radius: 999px; text-decoration: none; display: inline-block; text-align: center;
  font: 600 var(--step-0)/1 var(--sans); padding: 0.95rem 1.6rem; cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: #0d3b57; }
.btn-quiet { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--slate); }
.btn:disabled { background: var(--mist); color: #7d9692; border-color: transparent; cursor: not-allowed; }
.link {
  appearance: none; background: none; border: 0; padding: 0; color: var(--slate-ink);
  font: inherit; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer;
}

/* ---- intake ---------------------------------------------------------------------------------- */

.intro { display: grid; gap: 0.9rem; margin-bottom: 2rem; }
/* The practice's own logo, large, on the first screen the QR code or link opens. */
.practice-logo:empty { display: none; }
.practice-logo img { display: block; max-width: min(18rem, 70vw); max-height: 7.5rem; object-fit: contain; }
.practice-logo .practice-name { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 700; }
.details { display: grid; gap: 1rem; }
.consent-title { margin: 1.5rem 0 0.5rem; font-size: 1.05rem; }

.steps {
  list-style: none; margin: 0 0 1.5rem; padding: 0;
  display: flex; gap: 0.5rem;
  counter-reset: step;
}
.steps li {
  position: relative; flex: 1 1 0; min-width: 0; counter-increment: step; display: grid; justify-items: start; gap: 0.45rem;
  font-size: var(--step--1); line-height: 1.3; color: var(--slate-ink);
}
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 1.85rem; height: 1.85rem; border-radius: 50%;
  background: var(--white); border: 2px solid var(--line); font-size: 0.8rem; font-weight: 600; color: var(--slate-ink);
}
.steps li::after { content: ""; position: absolute; top: 0.9rem; left: 2.3rem; right: -0.3rem; height: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li.is-done::before { content: "✓"; background: var(--navy); border-color: var(--navy); color: var(--white); }
.steps li.is-done::after { background: var(--navy); }
.steps li.is-current { color: var(--navy); font-weight: 600; }
.steps li.is-current::before { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.panel { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 1.15rem; }
.panel legend { padding: 0; margin-bottom: 0.25rem; }
.panel legend:focus { outline: none; } /* focused by script when a step opens, so screen readers announce it */
.hint { color: var(--slate-ink); }

.field { display: grid; gap: 0.4rem; font-weight: 600; font-size: var(--step--1); }
.field em { font-style: normal; font-weight: 400; color: var(--slate-ink); }
.field input, .field textarea {
  width: 100%; font: 400 var(--step-0)/1.4 var(--sans); color: var(--navy);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.85rem 0.95rem;
}
.field textarea { resize: vertical; min-height: 5.5rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--slate); box-shadow: 0 0 0 3px var(--mist); }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: -0.4rem; }
.chip {
  appearance: none; font: 400 var(--step--1)/1 var(--sans); color: var(--navy);
  background: var(--mist); border: 1px solid transparent; border-radius: 999px; padding: 0.55rem 0.85rem; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--white); border-color: var(--slate); }

.consent {
  display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: start;
  padding: 1rem; background: var(--mist); border-radius: var(--radius-sm); font-size: var(--step--1);
}
.consent input { width: 1.15rem; height: 1.15rem; margin: 0.15rem 0 0; accent-color: var(--accent); }
.consent-text { display: grid; gap: 0.6rem; margin-bottom: 0.25rem; padding: 1rem 1.1rem; background: var(--page); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 0.95rem; }

.tips { margin: 0; padding: 0; list-style: none; color: var(--slate-ink); display: grid; gap: 0.5rem; }
.tips li { position: relative; padding-left: 1.75rem; }
.tips li::before { content: ""; position: absolute; left: 0; top: 0.2em; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--accent); }
.tips li::after { content: ""; position: absolute; left: 0.37rem; top: 0.42em; width: 0.28rem; height: 0.5rem; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }

.drop-target {
  position: relative; display: grid; place-items: center; gap: 0.75rem; min-height: 15rem; padding: 1.25rem;
  border: 2px dashed color-mix(in srgb, var(--accent) 65%, var(--line)); border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 7%, var(--white));
  cursor: pointer; text-align: center; overflow: hidden;
}
.drop-target:hover { background: color-mix(in srgb, var(--accent) 12%, var(--white)); }
.drop input:focus-visible + .drop-target { outline: 3px solid var(--accent); outline-offset: 2px; }
.drop-guide { width: 7.5rem; height: auto; color: var(--accent-ink); }
.drop-cta { padding: 0.7rem 1.35rem; border-radius: 999px; background: var(--navy); color: var(--white); font-weight: 600; }
.drop-sub { font-size: var(--step--1); color: var(--slate-ink); }
.drop.has-photo .drop-target { border-style: solid; border-color: var(--line); padding: 0.5rem; }
.drop-preview { width: 100%; max-height: 22rem; object-fit: contain; border-radius: var(--radius-sm); }
.drop-file { font-size: var(--step--1); color: var(--slate-ink); }

.check { min-height: 1.5rem; font-size: var(--step--1); display: grid; gap: 0.2rem; }
.check.is-pending { color: var(--slate-ink); }
.check.is-ok { color: var(--ok); }
.check.is-bad { color: var(--warn); }
.check strong { font-weight: 600; }

.form-error { color: var(--warn); font-size: var(--step--1); }

.actions { display: flex; gap: 0.75rem; justify-content: space-between; align-items: center; margin-top: 0.5rem; }
.actions .btn-primary { margin-left: auto; }

/* ---- processing ------------------------------------------------------------------------------ */

.processing { display: grid; gap: 1.25rem; }
.processing .stages li:last-child { border-bottom: 0; }
.stages { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.15rem; }
.stages li {
  display: grid; grid-template-columns: 1.75rem 1fr; align-items: center;
  padding: 0.7rem 0; border-bottom: 1px solid var(--line); color: #8aa39f;
}
.stages li::before {
  content: ""; width: 0.75rem; height: 0.75rem; border-radius: 50%; border: 2px solid currentColor;
}
.stages li.is-done { color: var(--slate-ink); }
.stages li.is-done::before { background: var(--navy); border-color: var(--navy); }
.stages li.is-current { color: var(--navy); font-weight: 600; }
.stages li.is-current::before { border-color: var(--accent); background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(0.6); opacity: 0.6; } }

.meter { height: 4px; background: var(--mist); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; width: var(--progress, 4%); background: var(--accent); transition: width 600ms ease; }

.notice { display: grid; gap: 1rem; }
.notice-message { font-size: var(--step-1); line-height: 1.45; }

/* ---- results ----------------------------------------------------------------------------------- */

.greeting { display: grid; gap: 0.5rem; margin-bottom: clamp(1.5rem, 4vw, 2.5rem); max-width: 44rem; }

.viewer { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 900px) {
  .viewer { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 2.5rem; }
  .viewer.is-plan-only { grid-template-columns: minmax(0, 44rem); }
}

/* Selfie (the whole photo) or Close-up (the mouth): the same slider with a different pair of photos. */
.view { display: grid; gap: 0.75rem; }
.tabs { display: inline-flex; justify-self: start; padding: 0.2rem; background: var(--mist); border-radius: 999px; }
.tabs button {
  appearance: none; border: 0; background: transparent; color: var(--slate-ink); cursor: pointer;
  font: 600 var(--step--1)/1 var(--sans); padding: 0.55rem 1.1rem; border-radius: 999px;
}
.tabs button[aria-pressed="true"] { background: var(--navy); color: var(--white); }

.compare {
  position: relative; margin: 0; border-radius: var(--radius); overflow: hidden;
  background: var(--navy); touch-action: pan-y; user-select: none; --pos: 50%;
}
.compare img { width: 100%; height: auto; pointer-events: none; }
.compare-after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.compare-after img { height: 100%; object-fit: cover; }
.compare-seam {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px;
  background: var(--accent); pointer-events: none;
}
.compare-seam::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 2.6rem; height: 2.6rem; margin: -1.3rem 0 0 -1.3rem;
  border-radius: 50%; background: var(--accent); border: 3px solid var(--white);
}
.compare-range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize;
}
.compare-range:focus-visible ~ .compare-seam::after { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent); }
.compare-tag {
  position: absolute; top: 0.75rem; padding: 0.3rem 0.65rem; border-radius: 999px;
  background: rgba(8, 42, 62, 0.72); color: var(--white); font-size: var(--step--1); pointer-events: none;
}
.compare-tag.before { left: 0.75rem; }
.compare-tag.after { right: 0.75rem; }

.side { display: grid; gap: 1.25rem; }
.options { display: grid; gap: 0.75rem; }
.option {
  appearance: none; text-align: left; font: inherit; color: var(--navy); cursor: pointer;
  display: grid; gap: 0.3rem; padding: 1rem 1.1rem; border-radius: var(--radius);
  background: var(--white); border: 1.5px solid var(--line);
}
.option:hover { border-color: var(--slate); }
.option[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.option-title { font-family: var(--display); font-size: var(--step-2); line-height: 1.1; }
.option-sub { font-size: var(--step--1); color: var(--slate-ink); }
.full-link { font-size: var(--step--1); }

.summary { margin-top: 0.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); display: grid; gap: 0.6rem; }
.summary p { font-size: var(--step-1); line-height: 1.5; }

.retake-note { margin: 0.75rem 0 0; padding: 0.6rem 0.8rem; border-left: 3px solid var(--accent); background: var(--mist); }
.outcome-note { margin: 0 0 1rem; padding: 0.6rem 0.8rem; border-left: 3px solid var(--line); background: var(--mist); }

.plan { margin-top: clamp(2.5rem, 6vw, 4rem); display: grid; gap: 1rem; }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 0.75rem; counter-reset: plan; }
.plan-item {
  counter-increment: plan; display: grid; grid-template-columns: 2.25rem 1fr; column-gap: 1rem; row-gap: 0.4rem;
  padding: 1.25rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
}
.plan-item::before {
  content: counter(plan); grid-row: span 4; display: grid; place-items: center; width: 2.25rem; height: 2.25rem;
  border-radius: 50%; background: var(--mist); color: var(--accent-ink); font-size: 1rem; font-weight: 600;
}
.plan-item.is-primary { border-color: var(--accent); }
.plan-item.is-primary::before { background: var(--accent); color: var(--on-accent); }
.plan-head { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: baseline; }
.plan-role { font-size: var(--step--1); color: var(--slate-ink); }
.plan-item.is-primary .plan-role { color: var(--accent-ink); font-weight: 600; }
.plan-item p { max-width: 42rem; }
.plan-expect { color: var(--slate-ink); }
.plan-note { font-size: var(--step--1); color: var(--warn); }

.next { margin-top: 2rem; display: grid; gap: 0.75rem; }
.next ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.next li { position: relative; padding-left: 1.75rem; }
.next li::before { content: ""; position: absolute; left: 0; top: 0.2em; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--accent); }
.next li::after { content: ""; position: absolute; left: 0.37rem; top: 0.42em; width: 0.28rem; height: 0.5rem; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* the next step: book a consult, or the practice will call */
.cta {
  margin-top: clamp(2rem, 5vw, 3rem); padding: clamp(1.5rem, 5vw, 3rem); border-radius: var(--radius);
  background: var(--navy); color: var(--white); display: grid; gap: 1rem; justify-items: start;
}
.cta p { color: #c9d9d6; max-width: 36rem; }
.cta .btn-primary { background: var(--accent); color: var(--on-accent); }
.cta .btn-primary:hover { background: var(--accent); filter: brightness(1.1); }
.cta .book-error { color: #ffd2c7; }

.disclaimer { margin-top: 2rem; font-size: var(--step--1); color: var(--slate-ink); max-width: 52rem; }
.side .disclaimer { margin: 0 0 1rem; text-align: left; }
.privacy { margin-top: 2.5rem; font-size: var(--step--1); display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.privacy .link { padding: 0.65rem 1.1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--navy); text-decoration: none; }
.privacy .link:hover { border-color: var(--slate); }

.state { max-width: 36rem; display: grid; gap: 1rem; }

/* privacy and terms */
.legal { max-width: 44rem; padding-bottom: 3rem; }
.legal h1 { margin-bottom: 1rem; }
.legal h2 { margin-top: 2rem; font-size: var(--step-2); }
.legal ul { padding-left: 1.25rem; }

@media (max-width: 520px) {
  h1, .h1 { font-size: 2.2rem; }
  h2, .h2 { font-size: 1.8rem; }
  .actions { flex-wrap: wrap; }
}

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