/* Instant quote estimate page + widget (scoped) */

.page-quote-estimate .quote-estimate-card {
  max-width: 54rem;
}

.quote-estimate-lead-header {
  margin-bottom: 1rem;
}

.quote-estimate-form .grid input,
.quote-estimate-form .grid select,
.quote-estimate-form .grid textarea {
  width: 100%;
}

.quote-estimate-widget-divider {
  height: 1px;
  margin: 2rem 0 1.5rem;
  border: 0;
  background: linear-gradient(
    90deg,
    transparent,
    var(--hairline, rgba(16, 24, 40, 0.16)),
    transparent
  );
}

.instant-estimate-widget {
  margin: 0;
  padding: 0;
}

/* k3-core sets `input { width:100% }` — reset checkbox/radio controls */
.instant-estimate-widget input[type="checkbox"],
.instant-estimate-widget input[type="radio"] {
  width: 1.125rem !important;
  min-width: 1.125rem;
  max-width: none;
  height: 1.125rem;
  flex: 0 0 1.125rem;
  padding: 0;
  margin: 0.2rem 0 0;
  border-radius: 4px;
  align-self: flex-start;
  cursor: pointer;
}

.qe-opt-list,
.qe-addon-list {
  width: 100%;
  margin: 0.35rem 0 0;
  padding: 0;
}

.qe-opt-list li,
.qe-addon-list li {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.qe-opt-list li + li,
.qe-addon-list li + li {
  margin-top: 0.5rem;
}

.qe-checkbox {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  max-width: 100%;
  margin: 0;
  cursor: pointer;
  font-size: 0.92rem;
  line-height: 1.45;
  font-weight: 500;
}

.qe-checkbox > span {
  flex: 1 1 auto;
  min-width: 0;
}

.qe-checkbox strong {
  font-weight: 800;
}

.qe-next-step-callout {
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 0.85rem;
  padding: 0.9rem 1.05rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(24, 182, 169, 0.08), rgba(46, 107, 255, 0.06));
  border: 1px solid rgba(53, 87, 156, 0.22);
  color: var(--text, #101828);
}

.qe-next-step-callout strong {
  font-weight: 800;
}

.qe-consent-muted {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted, #667085);
  margin: 0;
}

.qe-consent-muted a {
  color: var(--brand-deep, #35579c);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.quote-estimate-widget__title {
  margin-bottom: 0.35rem;
}

.quote-estimate-form-actions {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline, rgba(16, 24, 40, 0.12));
}

.qe-fieldset {
  border: 0;
  margin: 0 0 1.5rem;
  padding: 0;
}

.qe-legend {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: var(--text, #101828);
}

.qe-hint {
  font-size: 0.92rem;
  color: var(--muted, #667085);
  margin: 0 0 0.75rem;
}

.qe-stepper-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

@media (min-width: 640px) {
  .qe-stepper-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.qe-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--hairline, rgba(16, 24, 40, 0.12));
  border-radius: 10px;
  background: #fff;
}

.qe-stepper-label {
  font-size: 0.92rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.qe-stepper-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.qe-stepper-val {
  min-width: 1.75rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.qe-stepper-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  border: 1px solid var(--hairline, rgba(16, 24, 40, 0.18));
  background: var(--surface-2, #f6f8fb);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  color: inherit;
}

.qe-stepper-btn:hover {
  background: #e8ecf3;
}

.qe-binary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--hairline, rgba(16, 24, 40, 0.12));
  border-radius: 10px;
  background: #fff;
}

.qe-binary-label {
  font-size: 0.92rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.qe-binary-choices {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem;
  border: 1px solid var(--hairline, rgba(16, 24, 40, 0.14));
  border-radius: 999px;
  background: var(--surface-2, #f6f8fb);
  flex-shrink: 0;
}

.qe-binary-choice {
  position: relative;
  margin: 0;
}

.qe-binary-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  margin: 0;
}

.qe-binary-choice span {
  display: inline-block;
  min-width: 2.6rem;
  padding: 0.3rem 0.6rem;
  text-align: center;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted, #667085);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.qe-binary-choice input:checked + span {
  background: #fff;
  color: var(--brand-deep, #35579c);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.2);
}

/* White stepper chips on dark pages: inherit light body text — force navy on labels/value/buttons */
:root[data-theme="dark"] .qe-stepper,
:root[data-theme="dark"] .qe-stepper-label,
:root[data-theme="dark"] .qe-stepper-val,
:root[data-theme="dark"] .qe-stepper-btn,
:root[data-theme="dark"] .qe-binary,
:root[data-theme="dark"] .qe-binary-label,
:root[data-theme="dark"] .qe-binary-choice span {
  color: #172026;
}

:root[data-theme="dark"] .qe-stepper-btn {
  background: #eef1f6;
  border-color: rgba(16, 24, 40, 0.22);
}

:root[data-theme="dark"] .qe-binary-choices {
  background: #eef1f6;
  border-color: rgba(16, 24, 40, 0.22);
}

:root[data-theme="dark"] .qe-binary-choice input:checked + span {
  background: #fff;
  color: #172026;
}

:root[data-theme="dark"] .qe-stepper-btn:hover {
  background: #e4e7ec;
  color: #172026;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .qe-stepper,
  :root:not([data-theme="light"]):not([data-theme="dark"]) .qe-stepper-label,
  :root:not([data-theme="light"]):not([data-theme="dark"]) .qe-stepper-val,
  :root:not([data-theme="light"]):not([data-theme="dark"]) .qe-stepper-btn,
  :root:not([data-theme="light"]):not([data-theme="dark"]) .qe-binary,
  :root:not([data-theme="light"]):not([data-theme="dark"]) .qe-binary-label,
  :root:not([data-theme="light"]):not([data-theme="dark"]) .qe-binary-choice span {
    color: #172026;
  }

  :root:not([data-theme="light"]):not([data-theme="dark"]) .qe-stepper-btn {
    background: #eef1f6;
    border-color: rgba(16, 24, 40, 0.22);
  }

  :root:not([data-theme="light"]):not([data-theme="dark"]) .qe-binary-choices {
    background: #eef1f6;
    border-color: rgba(16, 24, 40, 0.22);
  }

  :root:not([data-theme="light"]):not([data-theme="dark"]) .qe-binary-choice input:checked + span {
    background: #fff;
    color: #172026;
  }

  :root:not([data-theme="light"]):not([data-theme="dark"]) .qe-stepper-btn:hover {
    background: #e4e7ec;
    color: #172026;
  }
}

.qe-details {
  margin-top: 1rem;
  padding: 0.55rem 0;
}

/* Stacked optional / add-on disclosures: tighter gap, no extra top margin on inner details */
.qe-fieldset--collapse {
  margin-bottom: 0.35rem;
}

.qe-fieldset--collapse .qe-details {
  margin-top: 0;
  padding: 0.3rem 0;
}

.qe-fieldset--collapse + .qe-fieldset--collapse {
  margin-top: 0;
}

.qe-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted, #667085);
}

.qe-details summary::marker {
  color: var(--muted, #667085);
}

.qe-tag {
  font-size: 0.8rem;
  color: var(--muted, #667085);
  white-space: nowrap;
}

.qe-addon-note {
  font-size: 0.88rem;
  color: var(--muted, #667085);
  margin: 0 0 0.75rem;
  font-style: italic;
}

.qe-output-wrap {
  margin-top: 1.25rem;
}

#quote-lead-start,
#quote-contact {
  scroll-margin-top: 6rem;
}
