/* Roofing quiz v2 - Comparisons.org
   Content + logic: roofing/30500036.php (30500045). Design: our windows page 26700070 (same base as home-warranty-v2). */

:root{
  --primary:#047857;
  --primary-light:#ecfdf5;
  --primary-dark:#065f46;
  --ink:#0f172a;
  --muted:#475569;
  --soft:#64748b;
  --line:#e2e5e8;
  --bg:#f2f4f7;
  --white:#fff;
  --hairline:rgba(60,60,67,.12);
  --fill:rgba(118,118,128,.12);
  --radius-card:20px;
  --radius-btn:14px;
  --ease:cubic-bezier(.25,.1,.25,1);
  --pad:16px;
  /* Clear shadow on answer options (Alex) */
  --option-shadow:0 1px 2px rgba(15,23,42,.06),0 6px 18px rgba(15,23,42,.09);
  --card-shadow:0 1px 2px rgba(15,23,42,.05);
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{background:var(--bg)}
body{
  /* Same font stack as our windows page (26700070) */
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",Inter,"Segoe UI",sans-serif;
  background:var(--bg);color:var(--ink);
  font-size:17px;line-height:1.4;
  -webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent;
}
img,svg{display:block}
ul{list-style:none}
a{color:inherit}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* ---------- Header ---------- */
.header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px var(--pad);height:52px}
.logo{height:30px;width:auto}
.disclosure-link{flex:none;font-size:11px;color:rgba(100,116,139,.8);text-decoration:underline;text-decoration-color:rgba(100,116,139,.35);text-underline-offset:2px;cursor:pointer;white-space:nowrap}
/* Advertiser Disclosure - step 1 only */
body:not([data-step="1"]) .disclosure-link{visibility:hidden}

/* ---------- Main + steps ---------- */
/* min-height keeps the footer out of the first screen on every step (AGENTS.md) */
.main{padding:0 var(--pad);min-height:calc(100svh - 52px);overflow-x:clip}
.screen-container{width:100%;max-width:560px;margin:0 auto}
.step{display:none;flex-direction:column;padding-bottom:14px}
.step.is-active{display:flex;animation:stepIn .35s var(--ease)}
@keyframes stepIn{from{opacity:0;transform:translateX(24px)}to{opacity:1;transform:none}}

/* ---------- Quiz nav: Back (own row, top left) -> "X / 3 Questions" + % -> bar (AGENTS.md) ---------- */
.quiz-nav{padding:8px 0 14px;margin-bottom:20px;border-bottom:.5px solid var(--hairline)}
.quiz-back-btn{display:inline-flex;align-items:center;gap:2px;font-size:16px;color:var(--primary);padding:4px 0;margin-bottom:6px}
.quiz-back-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.quiz-nav-meta{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:8px}
.quiz-step-text{font-size:13px;font-weight:600;letter-spacing:.4px;color:var(--soft);text-transform:uppercase}
.quiz-percent{font-size:13px;font-weight:700;color:var(--primary)}
.quiz-progress-bar{display:block;width:100%;height:5px;background:var(--fill);border-radius:100px;overflow:hidden}
.quiz-progress-fill{display:block;height:100%;background:var(--primary);border-radius:100px}

/* ---------- Headings ---------- */
/* Sizes and weights = windows page 26700070 (Shahar, 17/11: headings were too bold / everything too big) */
.screen-header{margin-bottom:18px}
.eyebrow{font-size:15px;font-weight:600;letter-spacing:.2px;line-height:1.3;text-transform:uppercase;color:var(--primary);margin-bottom:20px;text-wrap:balance}
.headline{font-size:23px;font-weight:700;letter-spacing:-.5px;line-height:1.2;margin-bottom:14px;text-wrap:balance}
.screen-title{font-size:23px;font-weight:700;letter-spacing:-.5px;line-height:1.2;margin-bottom:4px;text-wrap:balance}
/* Step 1: the question sits under the headline - one level smaller */
.headline + .screen-title{font-size:18px;font-weight:600;letter-spacing:-.2px}
.screen-subtitle{font-size:15px;color:var(--muted);text-wrap:pretty}
.screen-subtitle strong{color:var(--ink);font-weight:600}
.first-fold{padding-top:clamp(8px,3dvh,40px)}

/* ---------- State select (same look as a text field, AGENTS / skill) ---------- */
.state-form{display:flex;flex-direction:column;gap:14px}
.state-select-wrapper{position:relative}
.state-icon,.state-chevron{position:absolute;top:50%;transform:translateY(-50%);color:var(--soft);pointer-events:none}
.state-icon{left:16px}
.state-chevron{right:16px}
.state-icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8}
.state-chevron svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.state-select{
  width:100%;height:56px;padding:0 44px 0 46px;font-family:inherit;font-size:16px;font-weight:500;color:var(--ink);
  background:var(--white);border:1px solid var(--line);border-radius:14px;outline:none;appearance:none;-webkit-appearance:none;
  box-shadow:var(--card-shadow);cursor:pointer;transition:border-color .2s,box-shadow .2s;text-overflow:ellipsis;
}
.state-select:invalid{color:var(--soft);font-weight:400}
.state-select option{color:var(--ink);font-weight:400}
.state-select:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(4,120,87,.15)}
.state-select:valid{border-color:var(--primary)}

/* ---------- CTA ---------- */
.btn-find{
  width:100%;height:52px;display:flex;align-items:center;justify-content:center;gap:8px;
  font-size:17px;font-weight:600;letter-spacing:-.2px;color:#fff;text-decoration:none;
  background:var(--primary);border-radius:var(--radius-btn);transition:transform .15s var(--ease),background .2s;
}
.btn-find:hover{background:var(--primary-dark)}
.btn-find:active{transform:scale(.97)}
.btn-find svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}

/* ---------- Check lines (live page's "✅" lines) ---------- */
/* Centered as a group, lines aligned to the same start (Shahar, 17/11) */
.check-list{display:flex;flex-direction:column;align-items:flex-start;gap:6px;width:fit-content;max-width:100%;margin:16px auto 0}
.check-list li{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:600;color:var(--primary-dark)}
.check-list svg,.callout svg{width:20px;height:20px;flex-shrink:0;padding:3px;border-radius:50%;background:var(--primary);fill:none;stroke:#fff;stroke-width:3.2;stroke-linecap:round;stroke-linejoin:round}

/* Step 3 note - windows "callout" style */
.callout{display:flex;align-items:center;gap:10px;font-size:15px;font-weight:500;color:var(--primary-dark);background:var(--primary-light);border-radius:var(--radius-btn);padding:12px 14px;margin-bottom:16px;text-wrap:pretty}

/* ---------- Answer options ---------- */
.options{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.option{
  position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;
  min-height:158px;padding:20px 12px 16px;background:var(--white);
  border:2px solid transparent;border-radius:var(--radius-card);box-shadow:var(--option-shadow);
  transition:border-color .2s var(--ease),transform .15s var(--ease);
}
.option:hover{border-color:rgba(4,120,87,.35)}
.option:active{transform:scale(.97)}
.option.selected{border-color:var(--primary)}
/* Yes / No: big check / X (Alex) */
.yn-icon{width:84px;height:84px;display:flex;align-items:center;justify-content:center;background:var(--primary-light);border-radius:50%;color:var(--primary)}
.yn-icon svg{width:48px;height:48px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
/* "No" in yellow (Alex, 15/11) */
.option--no .yn-icon{background:#fef3c7;color:#d97706}
.option--no.selected{border-color:#d97706}
/* Answer text 20px (Alex, 15/11) */
.option-title{display:block;font-size:20px;font-weight:600;letter-spacing:-.2px;line-height:1.25}

/* ---------- Loading ("Calculating", 1s) ---------- */
.step-loading.is-active{display:grid;min-height:calc(100svh - 52px);place-items:center;padding:20px 0 40px;position:relative;overflow:clip}
.loading{display:flex;flex-direction:column;align-items:center;text-align:center}
.radar{position:absolute;left:50%;top:50%;width:280px;height:280px;transform:translate(-50%,-50%);pointer-events:none}
.radar span{position:absolute;inset:0;border:1.5px solid rgba(4,120,87,.12);border-radius:50%;animation:radar 1.2s var(--ease) infinite;opacity:0}
.radar span:nth-child(2){animation-delay:.3s}
.radar span:nth-child(3){animation-delay:.6s}
@keyframes radar{from{transform:scale(.3);opacity:.8}to{transform:scale(1.5);opacity:0}}
.spinner{width:56px;height:56px;border-radius:50%;border:4px solid rgba(4,120,87,.15);border-top-color:var(--primary);animation:spin .8s linear infinite;margin-bottom:18px}
@keyframes spin{to{transform:rotate(360deg)}}
.loading-title{position:relative;font-size:21px;font-weight:700;letter-spacing:-.4px}

/* ---------- Result (windows result-screen design) ---------- */
.step-result.is-active{display:grid;min-height:calc(100svh - 52px);place-items:center;padding:16px 0 40px}
.result{width:100%;max-width:480px;background:var(--white);padding:24px 22px;border-radius:24px;box-shadow:0 24px 60px -16px rgba(15,23,42,.35)}
.result-card{background:var(--white);border:.5px solid var(--hairline);border-radius:var(--radius-card);padding:30px 18px 24px;margin-bottom:14px;text-align:center}
/* Partner logo directly on the card (transparent file) */
.result-logo{display:block;width:200px;max-width:100%;height:auto;margin:0 auto 14px}
/* Offer line as a "coupon" (AGENTS.md) */
.result-offer{display:inline-block;padding:11px 16px;font-size:17px;font-weight:500;line-height:1.3;color:var(--ink);background:#fff8e6;border:1.5px dashed #f2b544;border-radius:14px;text-wrap:balance}
.result-offer strong{font-size:19px;font-weight:700;letter-spacing:-.2px}
.result-muted{font-size:14px;color:var(--soft);text-align:center;margin-bottom:8px}
.info-box{background:var(--white);border:.5px solid var(--hairline);border-radius:var(--radius-btn);padding:4px 14px;margin-bottom:14px}
.info-row{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;padding:11px 0;position:relative}
.info-row + .info-row::before{content:"";position:absolute;top:0;left:24px;right:0;height:.5px;background:var(--hairline)}
.info-row svg{width:16px;height:16px;flex-shrink:0;fill:none;stroke:var(--primary);stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.info-label{font-size:14px;color:var(--muted)}
.info-value{margin-left:auto;font-size:14px;font-weight:700;color:var(--ink)}
.congrats{font-size:22px;font-weight:700;letter-spacing:-.4px;line-height:1.2;color:var(--primary);text-align:center;margin:4px 0 16px;text-wrap:balance}

/* All lines fade in together with the result screen (Shahar, 17/11) */
.resultLine{opacity:0;transform:translateY(8px);transition:opacity .3s ease,transform .3s ease}
.resultLine.show{opacity:1;transform:none}

.redirect-box{position:relative;display:flex;align-items:center;justify-content:center;gap:10px;height:48px;width:100%;max-width:320px;margin:0 auto;background:var(--fill);border-radius:var(--radius-btn);overflow:hidden}
.redirect-icon{width:24px;height:24px;border-radius:50%;background:rgba(4,120,87,.12);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.redirect-icon svg{width:12px;height:12px;fill:none;stroke:var(--primary);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;animation:spin 1.5s linear infinite}
.redirect-text{font-size:16px;font-weight:600;color:var(--muted);white-space:nowrap}
.count-num{color:var(--primary);font-weight:800}
.redirect-progress{position:absolute;left:0;right:0;bottom:0;height:3px}
.redirect-progress span{display:block;height:100%;width:0;background:var(--primary)}
.redirect-box.is-counting .redirect-progress span{animation:fill 4s linear forwards}
@keyframes fill{to{width:100%}}

/* Back from the partner: same screen, CTA instead of the countdown */
.result-cta{display:none}
body[data-step="return"] .result-cta{display:flex}
body[data-step="return"] .redirect-box{display:none}

/* ---------- Footer (approved, always at the bottom - margin-top 150px) ---------- */
.footer{margin-top:150px;background:var(--bg);border-top:1px solid var(--line);padding:28px var(--pad) 40px;text-align:center}
.footer__inner{max-width:820px;margin:0 auto}
.footer__lead{font-size:13px;color:var(--soft);margin-bottom:4px}
.footer__copy{font-size:13px;color:var(--soft);margin-bottom:14px}
.footer__legal{font-size:11.5px;line-height:1.6;color:var(--soft);margin-bottom:16px}
.footer__links{display:flex;flex-wrap:wrap;justify-content:center;gap:8px 16px}
.footer__links a{font-size:12.5px;color:var(--primary);text-decoration:none}
.footer__links a:hover{text-decoration:underline}

/* ---------- Advertiser Disclosure modal (CSS only) ---------- */
.modal{position:fixed;inset:0;z-index:100;display:none;align-items:flex-end;justify-content:center}
body:has(#disclosure-toggle:checked) .modal{display:flex}
.modal__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.4);backdrop-filter:blur(4px);cursor:pointer}
.modal__box{position:relative;background:#fff;border-radius:20px 20px 0 0;padding:28px 20px 34px;max-width:560px;width:100%}
.modal__title{font-size:17px;font-weight:600;margin-bottom:10px;padding-right:36px}
.modal__box p{font-size:14px;color:var(--muted);line-height:1.5}
.modal__close{position:absolute;top:14px;right:14px;width:30px;height:30px;border-radius:50%;background:var(--fill);display:flex;align-items:center;justify-content:center;font-size:20px;line-height:1;color:var(--soft);cursor:pointer}

/* ---------- Responsive ---------- */
@media (min-width:640px){
  :root{--pad:32px}
  .header{height:58px;padding:12px 32px}
  .main{min-height:calc(100svh - 58px)}
  .logo{height:34px}
  .screen-container{max-width:620px}
  .headline{font-size:30px}
  .screen-title{font-size:30px}
  .headline + .screen-title{font-size:20px}
  .screen-subtitle{font-size:16px}
  .option{min-height:176px}
  .modal{align-items:center;padding:20px}
  .modal__box{border-radius:20px;padding:28px 24px}
  .step-loading.is-active,.step-result.is-active{min-height:calc(100svh - 58px)}
}
@media (min-width:1024px){
  .first-fold{padding-top:48px}
}
@media (max-width:380px){
  .eyebrow{font-size:14px}
  .headline,.screen-title{font-size:21px}
  .options{gap:10px}
  .option{min-height:148px;padding:16px 8px 12px;gap:10px}
  .result{padding:20px 14px}
  .result-card{padding:26px 12px 20px}
  .result-offer strong{font-size:18px}
  .congrats{font-size:20px}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;transition:none!important}
}
