:root {
  --bg: #f4f2ed;
  --panel: #fffaf3;
  --panel-2: #f7efe3;
  --ink: #10213a;
  --muted: #5b6471;
  --line: rgba(16, 33, 58, 0.12);
  --accent: #f37800;
  --accent-2: #e8b55d;
  --good: #1f7a5f;
  --shadow: 0 24px 80px rgba(16, 33, 58, 0.16);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(243, 120, 0, 0.14), transparent 28%),
    radial-gradient(circle at right 15%, rgba(16, 33, 58, 0.08), transparent 22%),
    linear-gradient(180deg, #fbf7f1 0%, #f0ece4 100%);
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0 28px;
}

.hero-copy h1,
.card-head h2,
.summary-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.03em;
}

.hero-copy h1 {
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 0.95;
}

.lede {
  max-width: 60ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.hero-badge {
  min-width: 220px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(16, 33, 58, 0.92);
  color: #fff;
  box-shadow: var(--shadow);
}

.hero-badge span {
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.7);
}

.hero-badge strong {
  font-size: 1.1rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 243, 0.84);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.calculator {
  padding: 24px;
}

.card-head,
.summary-head,
.panel-topline,
.field-label-row,
.summary-row,
.estimate-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-head {
  margin-bottom: 18px;
}

.card-head h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.stepper {
  display: inline-flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
}

.step {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.step.is-active {
  background: var(--ink);
  color: #fff;
}

.panel {
  display: none;
  animation: fadeUp 220ms ease-out;
}

.panel.is-active {
  display: block;
}

.field,
.field input,
.field select,
.field textarea {
  width: 100%;
}

.field {
  display: block;
}

.field span,
.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 650;
}

.field-slider {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(247, 239, 227, 0.9));
}

.field-label-row output {
  color: var(--accent);
  font-weight: 800;
}

input[type="range"] {
  width: 100%;
  margin: 16px 0 12px;
  accent-color: var(--accent);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
  border: 1px solid rgba(16, 33, 58, 0.14);
  border-radius: 16px;
  padding: 14px 15px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

input[data-invalid="true"],
select[data-invalid="true"],
textarea[data-invalid="true"] {
  border-color: rgba(211, 75, 75, 0.8);
  box-shadow: 0 0 0 3px rgba(211, 75, 75, 0.08);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(243, 120, 0, 0.2);
  outline-offset: 2px;
}

.field-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.field-group {
  margin-top: 22px;
}

.group-head h3,
.panel-topline h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.group-head p,
.fine-print,
.summary-note,
.submit-result,
.field-help {
  color: var(--muted);
  line-height: 1.5;
}

.scope-help {
  margin: 8px 0 0;
  color: rgba(91, 100, 113, 0.88);
  font-size: 0.9rem;
}

.spec-list,
.toggle-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  align-items: stretch;
}

.spec-card,
.toggle-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 204px;
  padding: 16px;
  border: 1px solid rgba(16, 33, 58, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.toggle-card.is-disabled {
  opacity: 0.58;
}

.toggle-card.has-tooltip {
  z-index: 2;
}

.spec-card .spec-top,
.toggle-card .toggle-top {
  display: flex;
  flex: 1 1 auto;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.spec-card .spec-label,
.toggle-card .toggle-label {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.35;
}

.spec-card .spec-note,
.toggle-card .toggle-note {
  margin: 8px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.spec-pill,
.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(16, 33, 58, 0.05);
  color: var(--muted);
  font-size: 0.84rem;
}

.toggle-btn {
  position: relative;
  width: 56px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 33, 58, 0.18);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.toggle-btn:disabled {
  cursor: not-allowed;
  transform: none;
}

.scope-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 236px;
  max-width: min(320px, calc(100% - 20px));
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(179, 54, 54, 0.18);
  background: linear-gradient(180deg, rgba(255, 244, 244, 0.98), rgba(252, 233, 233, 0.96));
  color: rgba(122, 42, 42, 0.98);
  font-size: 0.82rem;
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(179, 54, 54, 0.12);
  pointer-events: none;
  transform: translate(-50%, -115%);
}

.toggle-btn::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(16, 33, 58, 0.2);
  transition: transform 160ms ease;
}

.toggle-btn.is-on {
  background: var(--accent);
}

.toggle-btn.is-on::before {
  transform: translateX(24px);
}

.toggle-btn:hover {
  transform: translateY(-1px);
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.panel-actions-split {
  justify-content: space-between;
  align-items: center;
}

.primary-btn,
.ghost-btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), #ff963a);
  color: #fff;
  box-shadow: 0 12px 24px rgba(243, 120, 0, 0.24);
}

.ghost-btn {
  background: rgba(16, 33, 58, 0.08);
  color: var(--ink);
}

.lead-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.field-wide {
  grid-column: 1 / -1;
}

.submit-result {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(31, 122, 95, 0.08);
  color: var(--good);
  min-height: 56px;
}

.summary {
  position: sticky;
  top: 18px;
  padding: 22px;
}

.summary-head h2 {
  font-size: 1.6rem;
}

.estimate-band {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(16, 33, 58, 0.96), rgba(30, 56, 94, 0.96));
  color: #fff;
}

.estimate-band .label,
.estimate-center .label {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.68);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.estimate-band strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1.1;
}

.estimate-divider {
  width: 1px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.14);
}

.estimate-center {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(243, 120, 0, 0.08);
  border: 1px solid rgba(243, 120, 0, 0.18);
}

.estimate-center strong {
  font-size: 1.45rem;
}

.summary-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.summary-row {
  padding: 10px 0;
}

.summary-row strong {
  font-size: 1rem;
}

.breakdown {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.breakdown li {
  padding: 12px 14px;
  border: 1px solid rgba(16, 33, 58, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.breakdown .item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.breakdown .item-head strong {
  font-size: 0.95rem;
}

.breakdown .item-foot {
  color: var(--muted);
  font-size: 0.84rem;
}

.summary-note-box {
  padding-top: 18px;
}

.zero-state-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(243, 120, 0, 0.08);
  border: 1px solid rgba(243, 120, 0, 0.16);
  color: var(--muted);
  line-height: 1.5;
}

.summary-note-box p:last-child {
  margin-bottom: 0;
}

.summary-note-box #pricing-disclaimer {
  color: rgba(151, 61, 61, 0.94);
  line-height: 1.55;
}

.summary-note-box code {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(179, 54, 54, 0.08);
  color: inherit;
}

.mini-estimate-bar {
  display: none;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero,
  .layout {
    flex-direction: column;
  }

  .layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .summary {
    position: static;
  }

  .spec-list,
  .toggle-list,
  .lead-grid {
    grid-template-columns: 1fr;
  }

  .spec-card,
  .toggle-card {
    min-height: 0;
  }

  .panel-actions-split {
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 20px, 1200px);
    padding-top: 18px;
  }

  .calculator,
  .summary {
    padding: 18px;
  }

  .field-meta {
    flex-wrap: wrap;
  }

  .estimate-band {
    padding: 14px;
  }

  .estimate-band strong {
    font-size: 1.4rem;
  }

  body {
    padding-bottom: 92px;
  }

  .mini-estimate-bar {
    position: fixed;
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: auto;
    min-height: 56px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 214, 126, 0.16);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(13, 24, 44, 0.98), rgba(23, 39, 68, 0.98));
    color: #fff;
    box-shadow: 0 20px 42px rgba(8, 16, 32, 0.34);
    backdrop-filter: blur(10px);
    z-index: 20;
    cursor: pointer;
    text-align: left;
  }

  .mini-estimate-bar[hidden] {
    display: none;
  }

  .mini-estimate-bar__icon,
  .mini-estimate-bar__chevron {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(255, 214, 126, 0.12);
    color: #fff6df;
    font-size: 0.92rem;
    font-weight: 800;
  }

  .mini-estimate-bar__chevron {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
  }

  .mini-estimate-bar__range {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
    font-size: 0.98rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
  }

  .mini-estimate-bar__dash {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
  }
}
