/* McCloud Gutter native estimate calculator — v0.2.2 test page */
:root {
  --mgec-navy: #0b2b5c;
  --mgec-blue: #184f8f;
  --mgec-sky: #eaf3fb;
  --mgec-gold: #f3b21b;
  --mgec-ink: #172234;
  --mgec-muted: #5a6676;
  --mgec-line: #d9e1ea;
  --mgec-panel: #ffffff;
  --mgec-soft: #f6f8fb;
  --mgec-good: #176b42;
  --mgec-bad: #a52a2a;
  --mgec-shadow: 0 18px 50px rgba(17, 40, 71, .12);
}

.estimate-test-banner {
  padding: .65rem 0;
  background: #fff3cd;
  border-bottom: 1px solid #e0c36a;
  color: #553f00;
  font-size: .92rem;
}

.estimate-hero {
  background: linear-gradient(135deg, rgba(11,43,92,.98), rgba(24,79,143,.92));
  color: #fff;
}
.estimate-hero h1 { color: #fff; max-width: 850px; }
.estimate-hero p { max-width: 820px; }
.estimate-hero .eyebrow { color: #ffcf58; }

.estimate-calculator-section {
  background: linear-gradient(180deg, #eef4fa 0%, #f8fafc 100%);
  padding-top: clamp(2rem, 5vw, 4.5rem);
  padding-bottom: clamp(3rem, 6vw, 6rem);
}

.estimate-calculator { color: var(--mgec-ink); }
.estimate-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, .75fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}

.estimate-input-panel,
.estimate-result-sticky,
.estimate-contact-section {
  background: var(--mgec-panel);
  border: 1px solid rgba(11,43,92,.12);
  border-radius: 22px;
  box-shadow: var(--mgec-shadow);
}
.estimate-input-panel { padding: clamp(1.2rem, 3vw, 2.25rem); }
.estimate-result-sticky { padding: clamp(1.2rem, 2.5vw, 1.8rem); position: sticky; top: 1.25rem; }

.estimate-section-heading {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}
.estimate-section-heading h2 { margin: 0 0 .25rem; font-size: clamp(1.25rem, 2vw, 1.6rem); color: var(--mgec-navy); }
.estimate-section-heading p { margin: 0; color: var(--mgec-muted); }
.estimate-section-spaced { margin-top: 2.2rem; }
.estimate-step {
  display: inline-grid;
  place-items: center;
  flex: 0 0 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--mgec-navy);
  color: #fff;
  font-weight: 800;
}

.estimate-field-grid,
.estimate-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.estimate-contact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.estimate-field,
.conditional-field label {
  display: flex;
  flex-direction: column;
  gap: .42rem;
  min-width: 0;
}
.estimate-field > span,
.conditional-field label > span,
.estimate-choice-fieldset legend {
  font-weight: 750;
  color: var(--mgec-ink);
  font-size: .94rem;
}
.estimate-field-wide { grid-column: 1 / -1; }
.estimate-field input,
.estimate-field select,
.estimate-field textarea,
.conditional-field input,
.conditional-field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #bdc9d6;
  border-radius: 10px;
  padding: .72rem .82rem;
  background: #fff;
  color: var(--mgec-ink);
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.estimate-field textarea { min-height: 110px; resize: vertical; }
.estimate-field input:focus,
.estimate-field select:focus,
.estimate-field textarea:focus,
.conditional-field input:focus {
  outline: none;
  border-color: var(--mgec-blue);
  box-shadow: 0 0 0 3px rgba(24,79,143,.14);
}

.estimate-choice-fieldset { border: 0; padding: 0; margin: 0; }
.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .45rem;
  padding: .35rem;
  border-radius: 12px;
  background: #edf2f7;
}
.segmented-control label { cursor: pointer; }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: .55rem .65rem;
  border-radius: 9px;
  color: #3d4b5d;
  font-weight: 750;
  text-align: center;
}
.segmented-control input:checked + span {
  background: var(--mgec-navy);
  color: #fff;
  box-shadow: 0 5px 14px rgba(11,43,92,.22);
}
.segmented-control input:focus-visible + span { outline: 3px solid rgba(243,178,27,.65); }

.input-suffix { position: relative; display: flex; align-items: center; }
.input-suffix input { padding-right: 3rem; }
.input-suffix > span {
  position: absolute;
  right: .8rem;
  color: var(--mgec-muted);
  font-weight: 700;
  pointer-events: none;
}

.estimate-toggle-list { display: grid; gap: .8rem; }
.estimate-toggle-card {
  border: 1px solid var(--mgec-line);
  border-radius: 14px;
  padding: 1rem;
  background: var(--mgec-soft);
}
.estimate-toggle-card > label {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  cursor: pointer;
}
.estimate-toggle-card input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: .15rem;
  accent-color: var(--mgec-navy);
}
.estimate-toggle-card strong { display: block; color: var(--mgec-navy); }
.estimate-toggle-card small { display: block; margin-top: .2rem; color: var(--mgec-muted); line-height: 1.35; }
.conditional-field { margin: .85rem 0 0 2rem; max-width: 260px; }

.leaf-guard-description {
  min-height: 1.4rem;
  margin-top: .55rem;
  color: var(--mgec-muted);
  font-size: .92rem;
}

.estimate-result-panel { min-width: 0; }
.estimate-result-sticky > .eyebrow { color: var(--mgec-blue); margin-bottom: .2rem; }
.estimate-result-sticky h2 { color: var(--mgec-navy); margin: 0 0 .45rem; }
.estimate-result-intro { color: var(--mgec-muted); }
.estimate-status { min-height: 1.4rem; margin: .8rem 0; color: var(--mgec-muted); font-size: .9rem; }
.estimate-status.loading, .lead-submit-status.loading { color: var(--mgec-blue); }
.estimate-status.success, .lead-submit-status.success { color: var(--mgec-good); }
.estimate-status.error, .lead-submit-status.error { color: var(--mgec-bad); }
.estimate-results { display: grid; gap: .9rem; }
.estimate-result-card {
  border: 1px solid #cbd8e6;
  border-radius: 15px;
  padding: 1rem;
  background: linear-gradient(180deg, #fff, #f4f8fc);
}
.estimate-result-card h3 { margin: 0; color: var(--mgec-navy); font-size: 1.05rem; }
.estimate-total,
.estimate-range {
  margin: .3rem 0 .1rem;
  color: var(--mgec-navy);
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: -.03em;
}
.estimate-tax-note,
.estimate-minimum-note { margin: .35rem 0; font-size: .83rem; color: var(--mgec-muted); }
.estimate-minimum-note { color: #725200; background: #fff3cd; padding: .5rem .65rem; border-radius: 8px; }
.estimate-result-card ul { margin: .8rem 0 0; padding-left: 1.15rem; color: #344356; font-size: .9rem; }
.estimate-result-card li + li { margin-top: .3rem; }
.estimate-disclaimer { margin: 1rem 0; font-size: .82rem; color: var(--mgec-muted); line-height: 1.45; }
.estimate-contact-toggle { width: 100%; }

.estimate-contact-section {
  margin-top: 2rem;
  padding: clamp(1.2rem, 3vw, 2.25rem);
  scroll-margin-top: 1rem;
}
.estimate-contact-section[hidden], .conditional-field[hidden], .downspout-choice[hidden] { display: none !important; }
.estimate-state { max-width: 130px; }
.estimate-honeypot { position: absolute !important; left: -99999px !important; width: 1px; height: 1px; overflow: hidden; }
.lead-submit-status { min-height: 1.5rem; margin-top: 1rem; font-weight: 700; }
.estimate-contact-consent { margin: .7rem 0 0; color: var(--mgec-muted); font-size: .8rem; }
.estimate-submit-row { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-top: .65rem; }

@media (max-width: 940px) {
  .estimate-layout { grid-template-columns: 1fr; }
  .estimate-result-panel { order: -1; }
  .estimate-result-sticky { position: static; }
  .estimate-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .estimate-contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .estimate-calculator-section { padding-left: 0; padding-right: 0; }
  .estimate-input-panel, .estimate-result-sticky, .estimate-contact-section { border-radius: 15px; }
  .estimate-field-grid, .estimate-contact-grid, .estimate-results { grid-template-columns: 1fr; }
  .estimate-field-wide { grid-column: auto; }
  .segmented-control { grid-template-columns: 1fr; }
  .estimate-result-panel {
    position: sticky;
    top: 0;
    z-index: 8;
    margin: 0 -.25rem;
  }
  .estimate-result-sticky { box-shadow: 0 10px 28px rgba(17,40,71,.18); }
  .estimate-result-intro, .estimate-result-card ul, .estimate-disclaimer { display: none; }
  .estimate-result-card { padding: .75rem; }
  .estimate-result-card + .estimate-result-card { margin-top: 0; }
  .estimate-total,
.estimate-range { font-size: 1.55rem; }
  .estimate-submit-row .btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .estimate-field input, .estimate-field select, .estimate-field textarea { transition: none; }
}
