/* =========================================================
   Stanizai Group — Quote Builder
   Page-specific styles only. Reuses tokens from styles.css
   (--gold, --bg, --surface, --text, --ease, etc.).
   ========================================================= */

/* ---------- Hero strip ---------- */
.qb-hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding-top: clamp(110px, 16vh, 160px);
  padding-bottom: clamp(28px, 5vw, 48px);
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(60% 90% at 80% -10%, rgba(216,180,106,.14), transparent 60%),
    linear-gradient(180deg, var(--bg-elev), var(--bg));
}
.qb-hero__glow {
  position: absolute; top: -40%; right: -10%; width: 640px; height: 640px; z-index: -1;
  pointer-events: none; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(216,180,106,.12), transparent 72%);
}
.qb-hero__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(30px, 5.4vw, 56px); line-height: 1.05; letter-spacing: -0.02em;
  max-width: 16ch;
}
.qb-hero__sub {
  margin-top: 18px; max-width: 56ch;
  font-size: clamp(16px, 1.7vw, 19px); color: var(--text-muted);
}

/* ---------- Layout: two columns ---------- */
.qb-section { padding-top: clamp(36px, 5vw, 64px); }
.qb-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(28px, 4vw, 56px); align-items: start;
}

/* ---------- Blocks (fieldsets) ---------- */
.qb-block { border: 0; padding: 0; margin: 0 0 clamp(34px, 5vw, 52px); min-width: 0; }
.qb-block__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -0.01em;
  padding: 0; margin-bottom: 22px;
}
.qb-subhead {
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
  margin: 30px 0 16px; color: var(--text);
}

/* ---------- BLOCK 1: Service radio-cards ---------- */
.qb-services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.qb-card {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 16px;
  align-items: start; padding: 20px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
}
.qb-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.qb-card__input {
  position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0;
}
.qb-card__check {
  position: absolute; top: 16px; right: 16px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); color: #0a0908;
  display: grid; place-items: center;
  transition: background .2s var(--ease), border-color .2s var(--ease), opacity .2s var(--ease);
}
.qb-card__check svg { opacity: 0; transition: opacity .15s var(--ease); }
.qb-card__icon {
  width: 50px; height: 50px; border-radius: 13px; display: grid; place-items: center;
  background: rgba(216,180,106,.12); color: var(--gold); flex: none;
}
.qb-card__body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.qb-card__name { font-family: var(--font-display); font-weight: 600; font-size: 16px; padding-right: 28px; }
.qb-card__sub { font-size: 13.5px; color: var(--text-muted); line-height: 1.45; }

/* Selected state — gold border + filled gold check */
.qb-card:has(.qb-card__input:checked) { border-color: var(--gold); background: var(--surface-2); }
.qb-card:has(.qb-card__input:checked) .qb-card__check { background: var(--gold); border-color: var(--gold); }
.qb-card:has(.qb-card__input:checked) .qb-card__check svg { opacity: 1; }
/* Keyboard focus ring on the card */
.qb-card:has(.qb-card__input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 3px; }

.qb-swap-note {
  margin-top: 14px; font-size: 13.5px; color: var(--gold); min-height: 0;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.qb-swap-note.is-visible { opacity: 1; transform: none; }

/* ---------- BLOCK 2: Coverage controls ---------- */
.qb-coverage { display: grid; gap: 18px; }
.qb-control {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; display: flex; flex-wrap: wrap; gap: 18px;
  align-items: center; justify-content: space-between;
}
.qb-control[hidden] { display: none; }
.qb-control__head { min-width: 0; }
.qb-control__label { display: block; font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.qb-control__help { font-size: 13.5px; color: var(--text-muted); margin-top: 5px; }

/* Stepper */
.qb-stepper { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.qb-stepper__btn {
  width: 44px; height: 44px; border-radius: 11px; flex: none;
  background: var(--bg); border: 1px solid var(--border-strong); color: var(--text);
  display: grid; place-items: center;
  transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
.qb-stepper__btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.qb-stepper__btn:disabled { opacity: .35; cursor: not-allowed; }
.qb-stepper__input {
  width: 58px; height: 44px; text-align: center;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.qb-stepper__input::-webkit-outer-spin-button,
.qb-stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qb-stepper__input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216,180,106,.16); }
.qb-stepper__unit { font-size: 14px; color: var(--text-muted); margin-left: 4px; }

/* Day toggle */
.qb-toggle {
  display: inline-flex; background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; gap: 4px; flex: none;
}
.qb-toggle__opt { position: relative; }
.qb-toggle__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.qb-toggle__opt span {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px; border-radius: 9px; font-size: 14.5px; font-weight: 500;
  color: var(--text-muted); transition: background .2s var(--ease), color .2s var(--ease);
}
.qb-toggle__opt span em { font-style: normal; color: var(--text-muted); font-size: 13px; }
.qb-toggle__opt:has(input:checked) span { background: var(--gold); color: #0a0908; }
.qb-toggle__opt:has(input:checked) span em { color: rgba(10,9,8,.7); }
.qb-toggle__opt:has(input:focus-visible) span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- BLOCK 3: Add-ons ---------- */
.qb-addons { display: grid; gap: 10px; }
.qb-addon {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 14px;
  align-items: center; padding: 15px 18px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.qb-addon:hover { border-color: var(--border-strong); background: var(--surface-2); }
.qb-addon__input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.qb-addon__box {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  border: 1.5px solid var(--border-strong); color: #0a0908;
  display: grid; place-items: center;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.qb-addon__box svg { opacity: 0; transition: opacity .15s var(--ease); }
.qb-addon:has(.qb-addon__input:checked) { border-color: var(--gold); }
.qb-addon:has(.qb-addon__input:checked) .qb-addon__box { background: var(--gold); border-color: var(--gold); }
.qb-addon:has(.qb-addon__input:checked) .qb-addon__box svg { opacity: 1; }
.qb-addon:has(.qb-addon__input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.qb-addon__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.qb-addon__name { font-size: 15px; font-weight: 500; line-height: 1.4; }
.qb-addon__benefit { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.qb-addon__price {
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums;
}

/* Add-on with embedded quantity stepper (extra photos) */
.qb-addon--qty { grid-template-columns: auto 1fr auto; }
.qb-addon--qty .qb-addon__qty {
  display: inline-flex; align-items: center; gap: 5px; margin-left: auto;
}
.qb-addon__qty .qb-stepper__btn { width: 38px; height: 38px; border-radius: 9px; }
.qb-addon__qty .qb-stepper__input { width: 46px; height: 38px; font-size: 15px; }

/* Location block spacing */
.qb-location { margin-top: 18px; }

/* ---------- BLOCK 5: Inline recap + breakdown ---------- */
.qb-recap {
  font-size: 15px; color: var(--text); line-height: 1.6;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px;
}
.qb-recap strong { color: var(--gold); font-weight: 600; }
.qb-breakdown {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 20px;
}
.qb-line {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14.5px;
}
.qb-line:last-child { border-bottom: 0; }
.qb-line__label { color: var(--text-muted); }
.qb-line__amount { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
.qb-line--discount .qb-line__label,
.qb-line--discount .qb-line__amount { color: var(--gold); }
.qb-line--total { border-top: 1px solid var(--border-strong); margin-top: 2px; padding-top: 14px; }
.qb-line--total .qb-line__label { color: var(--text); font-weight: 600; font-family: var(--font-display); }
.qb-line--total .qb-line__amount { color: var(--gold); font-weight: 600; font-size: 18px; font-family: var(--font-display); }
.qb-line.is-flash { animation: lineFlash .4s var(--ease); }
@keyframes lineFlash {
  0% { background: rgba(216,180,106,.18); }
  100% { background: transparent; }
}

/* ---------- BLOCK 6: details ---------- */
#detailsBlock { scroll-margin-top: 96px; }
.qb-tbd { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 0; margin-top: 4px; font-weight: 400; cursor: pointer; }
.qb-tbd input { width: 18px; height: 18px; accent-color: var(--gold); flex: none; }
.qb-tbd span { font-size: 14px; color: var(--text-muted); }
.qb-optional { font-weight: 400; color: var(--text-muted); font-size: 12.5px; }
.qb-trust { margin-top: 16px; font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* Field scroll-margin so the fixed mobile bar never covers the active input */
.qb-form .field input,
.qb-form .field textarea { scroll-margin-bottom: 120px; }

/* ---------- Success state ---------- */
.qb-success {
  background: var(--surface); border: 1px solid var(--gold); border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 44px); text-align: center;
}
.qb-success__mark {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 22px;
  background: rgba(216,180,106,.14); color: var(--gold); display: grid; place-items: center;
}
.qb-success__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.01em; margin-bottom: 14px;
}
.qb-success__body { color: var(--text-muted); font-size: 16px; line-height: 1.7; max-width: 52ch; margin: 0 auto; }
.qb-success__body strong { color: var(--text); font-weight: 600; }
.qb-success__links { margin-top: 22px; font-size: 14.5px; color: var(--text-muted); }
.qb-success__links a { color: var(--gold); }
.qb-success__links a:hover { color: var(--gold-bright); }
.qb-success__fallback { margin-top: 16px; font-size: 13.5px; color: var(--text-muted); }

/* ---------- RIGHT RAIL (sticky) ---------- */
.qb-rail { position: sticky; top: 96px; }
.qb-rail__card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px 24px;
}
.qb-rail__service {
  font-family: var(--font-display); font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .16em; color: var(--gold); margin-bottom: 14px;
}
.qb-rail__caption { font-size: 13px; color: var(--text-muted); }
.qb-rail__total {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.25rem, 5vw, 3rem); line-height: 1.05; color: var(--gold);
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 2px 0 8px;
}
.qb-rail__range { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }
.qb-rail__obligation { font-size: 12.5px; color: var(--text-muted); margin-top: 8px; }
.qb-rail__items {
  margin: 20px 0; padding: 4px 0; border-top: 1px solid var(--border);
}
.qb-rail__deposit {
  font-size: 13px; color: var(--text-muted); line-height: 1.55;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 20px;
}
.qb-rail__note { font-size: 12.5px; color: var(--text-muted); text-align: center; margin-top: 12px; }
.qb-rail .qb-line { font-size: 13.5px; padding: 9px 0; }
.qb-rail .qb-line--total .qb-line__amount { font-size: 16px; }

/* ---------- MOBILE BOTTOM BAR + SHEET (hidden on desktop) ---------- */
.qb-bar, .qb-sheet { display: none; }

@media (max-width: 1023px) {
  .qb-layout { grid-template-columns: 1fr; }
  /* On tablet/mobile the desktop rail is hidden; the fixed bar takes over */
  .qb-rail { display: none; }

  .qb-bar {
    display: flex; align-items: stretch; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(10,9,8,.96);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid var(--gold);
  }
  .qb-bar__summary {
    display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
    flex: 1 1 auto; text-align: left; padding: 4px 6px; position: relative;
  }
  .qb-bar__caption { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .12em; }
  .qb-bar__total {
    font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--gold);
    font-variant-numeric: tabular-nums; line-height: 1.1;
  }
  .qb-bar__chev { position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: var(--text-muted); transition: transform .2s var(--ease); }
  .qb-bar__summary[aria-expanded="true"] .qb-bar__chev { transform: translateY(-50%) rotate(180deg); }
  .qb-bar__cta { flex: 0 0 auto; }

  /* Bottom sheet */
  .qb-sheet {
    display: block; position: fixed; inset: 0; z-index: 130;
    visibility: hidden; pointer-events: none;
  }
  .qb-sheet.is-open { visibility: visible; pointer-events: auto; }
  .qb-sheet::before {
    content: ""; position: absolute; inset: 0; background: rgba(6,5,4,.6);
    opacity: 0; transition: opacity .3s var(--ease);
  }
  .qb-sheet.is-open::before { opacity: 1; }
  .qb-sheet__panel {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: var(--bg-elev); border-top: 1px solid var(--gold);
    border-radius: 20px 20px 0 0;
    padding: 22px 22px calc(110px + env(safe-area-inset-bottom));
    max-height: 80vh; overflow-y: auto;
    transform: translateY(100%); transition: transform .32s var(--ease);
  }
  .qb-sheet.is-open .qb-sheet__panel { transform: none; }
  .qb-sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
  .qb-sheet__title { font-family: var(--font-display); font-weight: 600; font-size: 19px; }
  .qb-sheet__close { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--text); background: rgba(255,255,255,.06); }
  .qb-sheet__caption { font-size: 13px; color: var(--text-muted); }
  .qb-sheet__total {
    font-family: var(--font-display); font-weight: 700; font-size: 2.5rem; color: var(--gold);
    font-variant-numeric: tabular-nums; line-height: 1.05; margin: 2px 0 6px;
  }
  .qb-sheet__range { font-size: 13.5px; color: var(--text-muted); margin-bottom: 16px; }
  .qb-sheet__items { border-top: 1px solid var(--border); padding-top: 4px; }
  .qb-sheet__deposit { font-size: 13px; color: var(--text-muted); margin-top: 16px; line-height: 1.55; }

  /* keep page content clear of the fixed bar */
  .qb-section { padding-bottom: 120px; }

  /* Touch targets: bump the extra-photos quantity stepper to 44px (C1) */
  .qb-addon__qty .qb-stepper__btn { width: 44px; height: 44px; }
  .qb-addon__qty .qb-stepper__input { height: 44px; }
}

/* ---------- Smaller phones ---------- */
@media (max-width: 560px) {
  .qb-services { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .qb-card { padding: 16px; gap: 12px; }
  .qb-card__icon { width: 42px; height: 42px; border-radius: 11px; }
  .qb-card__name { font-size: 14.5px; padding-right: 24px; }
  .qb-card__sub { font-size: 12.5px; }
  /* Wrapped controls align under their label instead of detaching right (C4) */
  .qb-control { gap: 14px; justify-content: flex-start; }
  /* Let the day-length toggle wrap on narrow screens (C3) */
  .qb-toggle { flex-wrap: wrap; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 400px) {
  .qb-services { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .qb-line.is-flash { animation: none; }
  .qb-swap-note { transition: none; }
  .qb-sheet__panel, .qb-sheet::before, .qb-bar__chev { transition: none; }
  .qb-card, .qb-addon, .qb-stepper__btn { transition: none; }
}
