/* Estimate booking pages (estimate.html, roofing/estimate.html): one question per screen. */

/* ---------- Estimate page (one question per screen) ---------- */
.wiz-page { background: var(--green-50); min-height: 100vh; min-height: 100svh; padding-bottom: 0; }
.wiz-header { background: var(--white); box-shadow: 0 1px 0 rgba(52, 53, 60, .12); }
.wiz-header .site-header__inner { height: 68px; gap: 10px; }
.wiz-header .brand__mark { width: 52px; }
@media (max-width: 420px) { .wiz-header .brand__name { font-size: 0.86rem; } .wiz-header .brand__name span { display: inline; } }
.wiz-call {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 999px;
  background: var(--char); color: var(--white);
}
.wiz-call svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }

.wiz { max-width: 640px; margin: 0 auto; padding: 18px 14px 40px; }
.wiz__card {
  background: var(--white); border-radius: 22px; padding: 18px 18px 26px;
  box-shadow: 0 1px 0 rgba(52, 53, 60, .06), 0 14px 36px -20px rgba(63, 90, 39, .5);
}
@media (min-width: 640px) { .wiz { padding-top: 40px; } .wiz__card { padding: 28px 36px 36px; } }

.wiz__top { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 6px 12px; align-items: center; margin-bottom: 22px; }
.wiz__back {
  grid-row: 1 / span 2; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer;
  border: 2px solid var(--line); border-radius: 12px; background: var(--white); color: var(--char);
}
.wiz__back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.wiz__back[disabled] { visibility: hidden; }
.wiz__bar { height: 8px; border-radius: 999px; background: var(--green-100); overflow: hidden; }
.wiz__bar span { display: block; height: 100%; background: var(--green); transform-origin: left; transform: scaleX(0); transition: transform .35s ease; border-radius: inherit; }
.wiz__count { font-size: 0.88rem; font-weight: 650; color: var(--muted); }

.wiz-q {
  font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 850; font-stretch: 110%; letter-spacing: -0.015em;
  margin-bottom: 18px; outline: none;
}
.wiz-help { margin: -8px 0 16px; color: var(--muted); }

.wiz-step.is-in { animation: wizIn .32s ease both; }
.wiz-step.is-back { animation: wizBack .32s ease both; }
@keyframes wizIn { from { opacity: 0; transform: translateX(22px); } }
@keyframes wizBack { from { opacity: 0; transform: translateX(-22px); } }
@media (prefers-reduced-motion: reduce) { .wiz-step.is-in, .wiz-step.is-back { animation: none; } .wiz__bar span { transition: none; } }

.opts { display: grid; gap: 10px; }
@media (min-width: 480px) { .opts { grid-template-columns: 1fr 1fr; } }
.opt { position: relative; display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 16px; cursor: pointer;
  border: 2px solid var(--line); border-radius: 16px; background: var(--white);
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.opt__icon { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--green-50); color: var(--green); }
.opt__icon svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.opt__label { font-weight: 750; font-size: 1.08rem; line-height: 1.2; }
.opt:hover { border-color: var(--green-600); }
.opt:active { transform: scale(.985); }
.opt:has(input:checked) { border-color: var(--green); background: var(--green-50); box-shadow: inset 0 0 0 1px var(--green); }
.opt:has(input:checked) .opt__icon { background: var(--green); color: var(--white); }
.opt:has(input:focus-visible) { outline: 3px solid var(--char); outline-offset: 3px; }
.opts--two { grid-template-columns: 1fr 1fr; }

.wiz-next { margin-top: 20px; }
.wiz-step .slots { margin-top: 16px; }
#when-err { margin-top: 12px; }

.wiz-done { box-shadow: none; padding: 10px 0 0; }
.wiz-done:focus { outline: none; }
.wiz-done h1 { font-size: 2.1rem; font-stretch: 112%; }
.wiz-done .success__when { font-size: 1.3rem; }
.wiz-done__owners { margin: 14px auto; max-width: 30rem; padding: 14px 16px; border-radius: 14px; background: var(--sun); color: var(--char); font-weight: 750; }

.wiz-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 22px; font-size: 0.88rem; color: var(--muted); }
.wiz-legal a { color: var(--muted); }

.lbl-short { display: none; }

/* first question: ZIP code */
.wiz-step .zip-big { font-size: 1.5rem !important; font-weight: 750; letter-spacing: 0.12em; text-align: center; min-height: 60px !important; }
.wiz-step .zip-big::placeholder { letter-spacing: 0; font-weight: 500; font-size: 1.1rem; }

/* "sorry, we can't take this job" */
.wiz-stop { text-align: center; padding: 8px 0 4px; outline: none; }
.wiz-stop__mark { width: 64px; height: 64px; margin: 0 auto 12px; fill: var(--sun); stroke: var(--char); stroke-width: 5; stroke-linecap: round; }
.wiz-stop h1 { font-size: 1.7rem; font-stretch: 110%; }
.wiz-stop p { margin: 10px auto 0; max-width: 28rem; color: var(--muted); }
.wiz-stop .success__actions { margin-top: 20px; }

/* ---------- Phones: every screen fits without scrolling ----------
   Tuned for the visible area of real phone browsers (address bar and toolbar showing):
   about 664px tall on an iPhone 14/15, 548px on an iPhone SE. */
@media (max-width: 600px) {
  .wiz-header .site-header__inner { height: 52px; }
  .wiz-header .brand__mark { width: 44px; }
  .wiz-header .lang-toggle { min-height: 36px; padding: 0 12px; font-size: 0.9rem; }
  .wiz-call { width: 36px; height: 36px; }
  .wiz-call svg { width: 17px; height: 17px; }

  .wiz { padding: 8px 8px 6px; }
  .wiz__card { padding: 10px 12px 12px; border-radius: 16px; }
  .wiz__top { margin-bottom: 10px; gap: 2px 10px; }
  .wiz__back { width: 36px; height: 36px; border-radius: 10px; }
  .wiz__count { font-size: 0.8rem; }
  .wiz-q { font-size: 1.32rem; margin-bottom: 10px; line-height: 1.12; }
  .wiz-help { margin: -4px 0 8px; font-size: 0.88rem; line-height: 1.35; }

  /* answers: two compact tiles per row, icon over the words */
  .opts, .opts--two { grid-template-columns: 1fr 1fr; gap: 8px; }
  .opt { flex-direction: column; justify-content: center; gap: 4px; min-height: 0; padding: 9px 6px; border-radius: 12px; text-align: center; }
  .opt__icon { width: 34px; height: 34px; border-radius: 9px; }
  .opt__icon svg { width: 24px; height: 24px; }
  .opt__label { font-size: 0.95rem; line-height: 1.15; }
  .opts > .opt:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* an odd last answer gets the full row */

  .wiz-next { margin-top: 10px; min-height: 48px; font-size: 1.02rem; }
  .wiz-step .btn--lg { min-height: 48px; font-size: 1.02rem; }

  /* schedule */
  .wiz-step .cal { padding: 6px; border-radius: 12px; }
  .wiz-step .cal__head { margin-bottom: 2px; }
  .wiz-step .cal__nav { width: 32px; height: 32px; border-radius: 8px; }
  .wiz-step .cal__month { font-size: 0.98rem; }
  .wiz-step .cal__dow span { font-size: 0.68rem; padding: 1px 0; }
  .wiz-step .cal__grid { gap: 2px; }
  .wiz-step .cal__day { aspect-ratio: auto; height: 31px; min-height: 0; font-size: 0.9rem; border-radius: 7px; }
  .wiz-step .cal__loading { padding: 8px 4px 4px; }
  .wiz-step .slots { margin-top: 8px; }
  .wiz-step .slots .fs__sub { margin: 0 0 5px; font-size: 0.84rem; }
  .wiz-step .slots__list { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .wiz-step .slot span { min-height: 40px; font-size: 0.86rem; border-radius: 8px; }
  #when-err { margin-top: 6px; }

  /* contact */
  .wiz-step .field { margin-bottom: 8px; }
  .wiz-step .field label, .wiz-step .code-row > label { margin-bottom: 3px; font-size: 0.9rem; }
  .wiz-step .field input[type="text"], .wiz-step .field input[type="tel"] { min-height: 44px; padding: 0 12px; border-radius: 9px; }
  .wiz-step .phone-row { flex-wrap: nowrap; gap: 6px; }
  .wiz-step .phone-row input { flex: 1 1 auto; min-width: 0; }
  .wiz-step .phone-row .btn { min-height: 44px; padding: 0 12px; font-size: 0.88rem; }
  .wiz-step .field__help { margin-top: 3px; font-size: 0.8rem; }
  .wiz-step .field__err { margin-top: 3px; font-size: 0.82rem; }
  .wiz-step .code-row { margin-top: 6px; padding: 8px; }
  .wiz-step .verified { margin-top: 4px; font-size: 0.92rem; }
  .wiz-step .field-grid { grid-template-columns: 0.9fr 1.5fr 1fr; gap: 0 6px; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .wiz-step .consent { margin-bottom: 8px; }
  .wiz-step .check { font-size: 0.76rem; line-height: 1.32; gap: 8px; }
  .wiz-step .check input { width: 20px; height: 20px; }
  .wiz-step .form__status { margin-bottom: 8px; padding: 8px 10px; font-size: 0.88rem; }
  .wiz-step .form__fine { display: none; }   /* the button already says it's free */

  .wiz-legal { margin-top: 8px; gap: 4px 14px; font-size: 0.74rem; }
  /* last screen: the consent text already links Terms and Privacy */
  .wiz:has(.wiz-step[data-step="contact"]:not([hidden])) .wiz-legal { display: none; }
  .wiz-step[data-step="contact"] .wiz-q { font-size: 1.05rem; margin-bottom: 8px; }
  .wiz-step #phone-help { display: none; }
  .wiz-step .check { font-size: 0.72rem; line-height: 1.3; }
  /* while the text-message code is being entered, the code row takes the phone row's place */
  .wiz-step .field:has(#codeRow:not([hidden])) > label[for="phone"],
  .wiz-step .field:has(#codeRow:not([hidden])) .phone-row:has(#phone) { display: none; }
  .wiz-step .field:has(#codeRow:not([hidden])) #phone-help { display: block; margin: 0 0 4px; font-weight: 650; color: var(--char); }
  .wiz-step .code-row { margin-top: 0; padding: 0; background: none; }
  .wiz-step .code-row > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .wiz-step .code-row .linkish { padding: 2px 0 0; font-size: 0.82rem; }
  /* each field shows its own message; skip the extra banner */
  .wiz-step .form__status { display: none; }

  .wiz-done h1 { font-size: 1.7rem; }
  .wiz-done .success__mark { width: 56px; height: 56px; margin-bottom: 8px; }
  .wiz-done .success__when { font-size: 1.12rem; margin: 6px 0; }
  .wiz-done__owners { margin: 10px auto; padding: 10px 12px; }
  .wiz-done .success__actions { margin-top: 12px; }
}

/* small phones (iPhone SE and similar): drop the extra help line; contact fields show their
   names inside the boxes (labels stay for screen readers) */
@media (max-width: 600px) and (max-height: 600px) {
  .wiz-step[data-step="contact"] .field > label:not(.check),
  .wiz-step[data-step="contact"] .field-grid label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .wiz-step .field input[type="text"], .wiz-step .field input[type="tel"] { min-height: 42px; }
  .wiz-step .phone-row .btn { min-height: 42px; }
  .wiz-step .cal__day { height: 29px; }
  .wiz-header .site-header__inner { height: 46px; }
  .wiz-header .brand__mark { width: 38px; }
  .wiz-header .lang-toggle, .wiz-call { min-height: 32px; height: 32px; }
  .wiz-call { width: 32px; }
  .wiz { padding: 6px 6px 4px; }
  .wiz__card { padding: 8px 10px 10px; }
  .wiz__top { margin-bottom: 6px; }
  .wiz__back { width: 32px; height: 32px; }
  .wiz-step .field { margin-bottom: 6px; }
  .wiz-step .field input[type="text"], .wiz-step .field input[type="tel"] { min-height: 40px; }
  .wiz-step .phone-row .btn { min-height: 40px; }
  .wiz-step .check { font-size: 0.68rem; line-height: 1.28; }
  .wiz-step .btn--lg { min-height: 44px; }
  .wiz-help, .wiz-step[data-step="when"] .wiz-help { display: none; }
  .wiz-q { font-size: 1.22rem; margin-bottom: 8px; }
  .opt { padding: 7px 6px; }
  .opt__icon { width: 30px; height: 30px; }
  .opt__icon svg { width: 21px; height: 21px; }
}
