/* Direction: Betna's ad system — warm cream paper, deep navy headlines in heavy Manrope,
   copper calls to action, a field-green "verified" accent, and real job photos. */
@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-variable.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --brand: #b56d34;          /* copper — overridden by the admin brand color */
  --brand-ink: #ffffff;
  --navy: #0f2b4c;
  --navy-2: #1d3d63;
  --ink: #0f2b4c;
  --ink-2: #44566d;
  --ink-3: #7a8798;
  --paper: #f7f3ec;
  --paper-2: #efe8dc;
  --surface: #ffffff;
  --line: #e4dccf;
  --line-strong: #cdbfa9;
  --ok: #1f7a3e;
  --danger: #b42318;
  --shadow-1: 0 1px 2px rgba(15, 43, 76, .06), 0 2px 8px rgba(15, 43, 76, .05);
  --shadow-2: 0 18px 40px -22px rgba(15, 43, 76, .45);
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 500 16px/1.55 var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 100% -8%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 62%),
    var(--paper);
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--font); font-weight: 800; letter-spacing: -.035em; margin: 0; color: var(--navy); }
h1 { font-size: clamp(2.3rem, 1.3rem + 3.8vw, 3.9rem); line-height: .98; max-width: 12ch; }
h1 em { font-style: normal; color: var(--brand); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.1rem); line-height: 1.08; }
h3 { font-size: 1.15rem; margin: 2rem 0 .75rem; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- chrome ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: rgba(247, 243, 236, .9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1000;
}
.brand { display: flex; align-items: center; }
.brand img { height: 46px; width: auto; display: block; }
.topbar-phone {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--navy); font-weight: 800; text-decoration: none; font-size: .95rem;
  padding: 9px 16px; border: 2px solid var(--navy); border-radius: var(--r-sm);
  transition: background .2s, color .2s;
}
.topbar-phone:hover { background: var(--navy); color: #fff; }

.shell { width: min(1080px, 100% - 32px); margin: 24px auto 0; }

.progress {
  list-style: none; padding: 0; margin: 0 0 18px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
}
.progress li {
  font-size: .7rem; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em;
  padding-top: 9px; border-top: 4px solid var(--line-strong);
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.progress li.done { border-color: var(--navy); color: var(--ink-2); }
.progress li.active { border-color: var(--brand); color: var(--navy); }

/* ---------- step card ---------- */
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  padding: clamp(20px, 4vw, 44px);
  animation: rise .5s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .step, .hero-media .photo { animation: none !important; } }

.eyebrow {
  margin: 0 0 12px; font-size: .8rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase;
  color: var(--brand);
}
.lede { color: var(--ink-2); font-size: 1.1rem; max-width: 46ch; margin: 18px 0 26px; }
.fine { color: var(--ink-3); font-size: .82rem; margin: 18px 0 0; }
.step-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }

/* ---------- hero (address step) ---------- */
.step-hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(24px, 4vw, 48px);
  align-items: center; overflow: hidden;
}
.hero-media { position: relative; min-height: 360px; }
.photo { margin: 0; border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-2); background: var(--paper-2); }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-main { position: absolute; inset: 0 0 64px 18px; animation: rise .7s var(--ease) .05s both; }
.photo-inset {
  position: absolute; left: 0; bottom: 0; width: 56%; aspect-ratio: 4 / 3;
  border: 5px solid var(--surface); animation: rise .7s var(--ease) .18s both;
}
.photo-inset figcaption {
  position: absolute; left: 8px; right: 8px; bottom: 8px;
  font-size: .72rem; font-weight: 800; letter-spacing: .02em; color: #fff;
  background: rgba(15, 43, 76, .86); padding: 6px 10px; border-radius: var(--r-xs);
}
.how-steps {
  grid-column: 1 / -1; list-style: none; margin: 8px 0 0; padding: 22px 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; border-top: 1px solid var(--line);
}
.how-steps li { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; font-size: .9rem; color: var(--ink-2); }
.how-steps strong { color: var(--navy); font-weight: 800; }
.how-steps li > span:last-child { grid-column: 2; }
.how-num {
  grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-weight: 800; font-size: .85rem;
}

/* ---------- buttons ---------- */
.btn {
  --bg: var(--surface); --fg: var(--navy);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 800 .95rem var(--font); color: var(--fg); background: var(--bg);
  border: 2px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 11px 20px; cursor: pointer; text-decoration: none; text-align: center;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s, border-color .2s;
}
.btn:hover { border-color: var(--navy); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 50%, transparent); outline-offset: 2px;
}
.btn-primary { --bg: var(--brand); --fg: var(--brand-ink); border-color: var(--brand); box-shadow: 0 8px 20px -10px var(--brand); }
.btn-primary:hover {
  --bg: color-mix(in srgb, var(--brand) 88%, #000); border-color: var(--bg);
  box-shadow: 0 12px 26px -10px var(--brand); transform: translateY(-1px);
}
.btn-ghost { --bg: transparent; }
.btn-link { border: 0; background: none; padding: 6px 0; color: var(--ink-2); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--navy); }
.btn-lg { padding: 15px 26px; font-size: 1.05rem; }
.btn-small { padding: 6px 12px; font-size: .8rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.is-active { --bg: var(--navy); --fg: #fff; border-color: var(--navy); }

/* ---------- address ---------- */
.address-form { position: relative; max-width: 600px; }
.address-label { display: block; font-size: .85rem; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.address-field {
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px; background: var(--surface);
  border: 2px solid var(--navy); border-radius: var(--r-md); box-shadow: var(--shadow-1);
  transition: box-shadow .2s var(--ease);
}
.address-field:focus-within { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); }
.address-pin { color: var(--brand); flex: none; }
.address-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: 600 1.05rem var(--font); padding: 11px 6px; color: var(--navy);
}
.address-field input::placeholder { color: var(--ink-3); font-weight: 500; }
.address-field .btn { padding: 10px 16px; font-size: .88rem; white-space: nowrap; box-shadow: 0 6px 14px -10px var(--brand); }

/* ---------- estimate notice (result step) ---------- */
.estimate-note {
  display: flex; gap: 12px; align-items: flex-start; margin: 0 0 18px;
  padding: 14px 16px; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--brand) 9%, #fff); border: 1.5px solid color-mix(in srgb, var(--brand) 35%, #fff);
  color: var(--ink-2); font-size: .9rem;
}
.estimate-note svg { color: var(--brand); flex: none; margin-top: 1px; }
.estimate-note p { margin: 0; }
.estimate-note strong { color: var(--navy); display: block; }
.estimate-note a { color: var(--navy); font-weight: 800; white-space: nowrap; }
.suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50;
  list-style: none; margin: 0; padding: 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2);
}
.suggestions li { padding: 11px 12px; border-radius: var(--r-sm); cursor: pointer; display: grid; }
.suggestions li span { font-weight: 800; color: var(--navy); }
.suggestions li small { color: var(--ink-3); font-weight: 600; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--paper); }
.form-error { color: var(--danger); font-weight: 700; font-size: .9rem; margin: 12px 0 0; }
.trust { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 10px 26px; color: var(--ink-2); font-size: .92rem; }
.trust strong { color: var(--navy); }
.trust li::before { content: "✓"; color: var(--ok); font-weight: 800; margin-right: 8px; }

/* ---------- map ---------- */
.map-wrap { position: relative; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: #1b2633; }
#map { height: clamp(320px, 52vh, 520px); width: 100%; }
#map.picking, #map.drawing { cursor: crosshair; }
.map-loading {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: rgba(15, 43, 76, .7); color: #fff; font-weight: 700; z-index: 600;
}
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.draw-banner {
  position: absolute; left: 12px; right: 12px; top: 12px; z-index: 650;
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: rgba(15, 43, 76, .92); color: #fff; padding: 10px 12px; border-radius: var(--r-sm); font-size: .9rem;
}
.draw-actions { display: flex; gap: 6px; }

.measure-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px;
  margin: -28px 16px 0; position: relative; z-index: 700;
  background: var(--navy); color: #fff; border-radius: var(--r-md); padding: 16px 20px; box-shadow: var(--shadow-2);
  border-bottom: 4px solid var(--brand);
}
.measure-stat { display: grid; }
.measure-num { font: 800 2rem/1 var(--font); letter-spacing: -.03em; }
.measure-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: rgba(255, 255, 255, .65); margin-top: 5px; }
.measure-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: .78rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); }
.chip.ok { background: color-mix(in srgb, var(--ok) 70%, transparent); border-color: transparent; }
.chip.warn { background: rgba(255, 196, 0, .2); border-color: rgba(255, 196, 0, .4); }
.roof-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ---------- details form ---------- */
.stack { display: grid; gap: 26px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-weight: 800; color: var(--navy); margin-bottom: 10px; padding: 0; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.segmented span {
  display: inline-block; padding: 11px 18px; border: 2px solid var(--line-strong); border-radius: var(--r-sm);
  font-weight: 700; font-size: .92rem; transition: all .15s var(--ease); background: var(--surface); color: var(--navy);
}
.segmented input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.segmented input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 50%, transparent); outline-offset: 2px; }
.segmented label:hover span { border-color: var(--navy); }
.segmented [data-detected] span { border-style: dashed; border-color: var(--brand); }

.material-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.material { position: relative; }
.material input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.material-body {
  display: grid; gap: 4px; height: 100%; padding: 14px 16px 16px; border: 2px solid var(--line-strong);
  border-radius: var(--r-md); background: var(--surface); transition: all .18s var(--ease);
}
.material-swatch { height: 38px; border-radius: var(--r-xs); margin-bottom: 8px; }
.material-name { font-weight: 800; color: var(--navy); }
.material-warranty { font-size: .8rem; color: var(--ink-3); font-weight: 600; }
.material:hover .material-body { border-color: var(--navy); transform: translateY(-2px); box-shadow: var(--shadow-1); }
.material input:checked + .material-body { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 24%, transparent); }
.material input:focus-visible + .material-body { outline: 3px solid color-mix(in srgb, var(--brand) 50%, transparent); }

.field { display: grid; gap: 6px; font-weight: 800; color: var(--navy); }
.field em { font-weight: 500; color: var(--ink-3); font-style: normal; }
.field input, .field select, .field textarea {
  font: 600 1rem var(--font); color: var(--navy); background: var(--surface);
  border: 2px solid var(--line-strong); border-radius: var(--r-sm); padding: 12px 14px; width: 100%;
}
.field textarea { resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink-3); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .84rem; color: var(--ink-2); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.check a { color: var(--navy); font-weight: 700; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.teaser {
  margin-bottom: 24px; padding: 22px; border-radius: var(--r-md); text-align: center;
  background: repeating-linear-gradient(135deg, var(--paper) 0 10px, var(--paper-2) 10px 20px); border: 2px dashed var(--line-strong);
}
.teaser-price { font: 800 2.3rem var(--font); filter: blur(9px); user-select: none; color: var(--navy); }

/* ---------- result ---------- */
.result-hero {
  border-radius: var(--r-md); padding: clamp(20px, 4vw, 34px); color: #fff;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  border-bottom: 6px solid var(--brand); box-shadow: var(--shadow-2);
}
.result-material { font-weight: 800; color: color-mix(in srgb, var(--brand) 55%, #fff); letter-spacing: .02em; }
.result-price { font: 800 clamp(2.3rem, 1.2rem + 4.6vw, 4rem)/1.02 var(--font); letter-spacing: -.04em; margin: 6px 0 10px; }
.result-sub { font-size: .92rem; opacity: .9; }
.result-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 6px; }
.compare { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.compare li {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; align-items: center;
  padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--r-sm);
}
.compare li.selected { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, #fff); }
.compare .c-name { font-weight: 800; color: var(--navy); }
.compare .c-warranty { font-size: .8rem; color: var(--ink-3); }
.compare .c-price { font: 800 1.1rem var(--font); color: var(--navy); grid-row: span 2; grid-column: 2; grid-row-start: 1; }
.how { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.how summary { cursor: pointer; font-weight: 800; color: var(--navy); }
.how ul { color: var(--ink-2); font-size: .92rem; }
.inspect {
  margin: 24px 0 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 0;
  border-radius: var(--r-md); overflow: hidden; background: var(--navy); color: rgba(255, 255, 255, .86);
}
.inspect img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 180px; }
.inspect figcaption { padding: 20px 22px; font-size: .92rem; display: grid; gap: 6px; align-content: center; }
.inspect strong { color: #fff; font-size: 1.15rem; letter-spacing: -.01em; }

/* ---------- footer ---------- */
.foot { width: min(1080px, 100% - 32px); margin: 28px auto 0; padding-bottom: 36px; }
.foot-band {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px;
  background: var(--navy); color: rgba(255, 255, 255, .78); border-radius: var(--r-lg); padding: 22px clamp(18px, 4vw, 32px);
  font-size: .9rem;
}
.foot-band strong { display: block; color: #fff; font-size: 1.2rem; letter-spacing: -.02em; }
.foot-email { color: #fff; font-weight: 700; }
.foot-legal { text-align: center; color: var(--ink-3); font-size: .74rem; margin: 18px 0 0; line-height: 1.7; }
.foot-legal a { color: var(--ink-2); font-weight: 700; }

/* ---------- embed mode (iframe inside a funnel) ---------- */
body.embed { background: transparent; min-height: 0; }
body.embed .topbar, body.embed .foot { display: none; }
body.embed .shell { margin-top: 8px; width: calc(100% - 16px); }

@media (max-width: 860px) {
  .step-hero { grid-template-columns: 1fr; }
  .hero-media { min-height: 0; aspect-ratio: 16 / 11; order: 2; }
  .how-steps { order: 3; }
}
@media (max-width: 600px) {
  .brand img { height: 38px; }
  .topbar-phone { padding: 8px 12px; font-size: .85rem; }
  .topbar-phone-label { display: none; }
  .address-field { flex-wrap: wrap; padding: 6px; }
  .address-pin { display: none; }
  .address-field input { padding: 12px 10px; }
  .address-field .btn { width: 100%; }
  .progress li { font-size: 0; padding-top: 0; }
  .how-steps { grid-template-columns: 1fr; gap: 12px; }
  .roof-actions .btn, .result-cta .btn { width: 100%; }
  .measure-card { margin: -20px 8px 0; }
  .inspect { grid-template-columns: 1fr; }
  .step { padding: 20px 16px; }
  .step-head { flex-wrap: wrap; gap: 6px 16px; }
  .material-grid { grid-template-columns: 1fr; gap: 8px; }
  .material-body { grid-template-columns: 44px 1fr; column-gap: 12px; row-gap: 2px; align-items: center; padding: 10px 12px; }
  .material-swatch { grid-row: span 2; width: 44px; height: 44px; margin: 0; }
  .segmented span { padding: 10px 14px; }
  .result-cta { flex-direction: column; }
  .estimate-note { font-size: .86rem; }
  .foot-band .btn { width: 100%; }
}
