:root {
  --ink: #102a43;
  --ink-soft: #52677a;
  --navy: #0a2d50;
  --blue: #145ce6;
  --blue-soft: #eaf1ff;
  --teal: #00a69b;
  --teal-soft: #e4f7f4;
  --paper: #ffffff;
  --canvas: #f3f6f8;
  --line: #dbe4ea;
  --shadow: 0 18px 60px rgba(16, 42, 67, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 4% 0%, rgba(20, 92, 230, 0.08), transparent 28rem),
    var(--canvas);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(20, 92, 230, 0.28);
  outline-offset: 3px;
}

.page-shell {
  min-height: 100vh;
  padding: 0 42px 42px;
}

.topbar {
  max-width: 1360px;
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(16, 42, 67, 0.1);
}

.brand {
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 12px 4px 12px 4px;
  color: white;
  background: linear-gradient(145deg, var(--blue), var(--teal));
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(20, 92, 230, 0.2);
}

.brand > span:last-child {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.brand b {
  font-size: 19px;
  letter-spacing: 0.04em;
}

.brand small {
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 13px;
}

.topbar-meta b {
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--navy);
  background: white;
  border: 1px solid var(--line);
}

.hero {
  max-width: 1360px;
  margin: 0 auto;
  padding: 54px 0 40px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 42px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 840px;
  margin: 0;
  color: var(--navy);
  font-size: clamp(36px, 4.2vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.048em;
}

.hero-copy {
  max-width: 720px;
  margin: 20px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.65;
}

.phase-nav {
  max-width: 1360px;
  margin: 0 auto 22px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.phase-item {
  min-height: 52px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8796a5;
  border: 1px solid transparent;
  border-radius: 12px;
}

.phase-item span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: #e8edf1;
  font-size: 12px;
}

.phase-item b {
  font-size: 13px;
}

.phase-item.active {
  color: var(--navy);
  background: white;
  border-color: var(--line);
  box-shadow: 0 7px 20px rgba(16, 42, 67, 0.06);
}

.phase-item.active span {
  color: white;
  background: var(--blue);
}

.phase-item.done {
  color: var(--teal);
}

.phase-item.done span {
  color: white;
  background: var(--teal);
}

.workspace {
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.68fr) minmax(330px, 0.82fr);
  align-items: start;
  gap: 22px;
}

.wizard-card,
.estimate-card {
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.wizard-card {
  min-height: 600px;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
}

.progress-row {
  padding: 21px 28px 12px;
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 12px;
}

.progress-row b {
  color: var(--navy);
}

.progress-track {
  height: 4px;
  margin: 0 28px;
  overflow: hidden;
  background: #edf1f4;
  border-radius: 999px;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
  transition: width 260ms ease;
}

.question-panel,
.result-panel {
  flex: 1;
  padding: 54px 62px 42px;
  animation: enter 220ms ease both;
}

.result-panel-inner {
  animation: enter 220ms ease both;
}

.loading-state {
  color: var(--ink-soft);
}

.error-state {
  max-width: 620px;
}

.error-state p {
  color: var(--ink-soft);
  line-height: 1.6;
}

.error-state button {
  margin-top: 14px;
  border: 0;
  border-radius: 13px;
  padding: 13px 17px;
  color: white;
  background: var(--blue);
  font-weight: 700;
}

.noscript-message {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 10;
  border-radius: 12px;
  padding: 14px 16px;
  color: white;
  background: #a02b2b;
  text-align: center;
}

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

.question-panel h2,
.result-panel h2 {
  max-width: 730px;
  margin: 0;
  color: var(--navy);
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.14;
  letter-spacing: -0.035em;
}

.question-panel > p:not(.eyebrow),
.result-heading p {
  max-width: 750px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.65;
}

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

.answer-button {
  min-height: 145px;
  padding: 22px;
  display: grid;
  grid-template-columns: 38px 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  column-gap: 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.answer-button:hover {
  transform: translateY(-2px);
  border-color: #9fb8d4;
  box-shadow: 0 12px 28px rgba(16, 42, 67, 0.09);
}

.answer-button > span {
  width: 38px;
  height: 38px;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 800;
}

.answer-button.yes > span {
  color: var(--teal);
  background: var(--teal-soft);
}

.answer-button.no > span {
  color: #7e8f9d;
  background: #eef2f4;
}

.answer-button b {
  align-self: end;
  color: var(--navy);
  font-size: 20px;
}

.answer-button small {
  align-self: start;
  color: var(--ink-soft);
}

.number-form {
  max-width: 540px;
  margin-top: 38px;
}

.number-form label {
  display: block;
  margin-bottom: 9px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
}

.number-form > div {
  display: flex;
  gap: 10px;
}

.number-form input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px 16px;
  color: var(--navy);
  background: #f8fafb;
  font-size: 18px;
  font-weight: 700;
}

.number-form button,
.result-actions button {
  border: 0;
  border-radius: 13px;
  padding: 13px 17px;
  color: white;
  background: var(--blue);
  font-weight: 700;
}

.wizard-footer {
  min-height: 66px;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.wizard-footer button {
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.wizard-footer button:hover:not(:disabled) {
  color: var(--blue);
}

.wizard-footer button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.estimate-card {
  position: sticky;
  top: 18px;
  border-radius: 20px;
  overflow: hidden;
}

.estimate-heading {
  min-height: 88px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background:
    linear-gradient(135deg, rgba(20, 92, 230, 0.95), rgba(0, 166, 155, 0.86)),
    var(--blue);
}

.estimate-heading p {
  margin: 0 0 5px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.78;
}

.estimate-heading h3 {
  margin: 0;
  font-size: 18px;
}

.estimate-heading > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.17);
  font-weight: 800;
}

.estimate-lines,
.result-list {
  padding: 10px 22px;
}

.summary-line {
  min-height: 58px;
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #edf1f4;
}

.summary-line > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.summary-line span {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.summary-line small {
  color: var(--ink-soft);
  font-size: 10px;
}

.summary-line strong {
  flex: 0 0 auto;
  color: var(--navy);
  font-size: 13px;
  white-space: nowrap;
}

.empty-estimate {
  margin: 18px 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.estimate-total {
  margin: 8px 22px 18px;
  padding: 17px 0 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  border-top: 2px solid var(--navy);
}

.estimate-total span {
  color: var(--ink-soft);
  font-size: 12px;
}

.estimate-total strong {
  color: var(--navy);
  font-size: 23px;
  letter-spacing: -0.03em;
}

.scope-note {
  margin: 0 14px 14px;
  padding: 13px;
  display: flex;
  gap: 10px;
  border-radius: 13px;
  background: var(--blue-soft);
}

.scope-note > span {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.scope-note p {
  margin: 0;
  color: #31506d;
  font-size: 11px;
  line-height: 1.45;
}

.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.result-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 11px;
  color: #087d75;
  background: var(--teal-soft);
  font-size: 11px;
  font-weight: 800;
}

.result-list {
  margin-top: 24px;
  padding: 0;
}

.total-card {
  margin-top: 22px;
  padding: 22px;
  display: grid;
  gap: 6px;
  border-radius: 17px;
  color: white;
  background: var(--navy);
}

.total-card span {
  font-size: 12px;
  opacity: 0.72;
}

.total-card strong {
  font-size: clamp(29px, 4vw, 44px);
  letter-spacing: -0.04em;
}

.total-card small {
  font-size: 11px;
  opacity: 0.68;
}

.result-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.result-actions button:nth-child(2) {
  color: var(--navy);
  background: var(--blue-soft);
}

.result-actions button.ghost {
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
}

.terms-strip {
  max-width: 1360px;
  margin: 22px auto 0;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.68);
}

.terms-strip > div + div {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.terms-strip p {
  margin: 0 0 5px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
}

.terms-strip span {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .page-shell {
    padding-inline: 22px;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .estimate-card {
    position: static;
    grid-row: 1;
  }

  .estimate-lines {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
  }

  .terms-strip {
    grid-template-columns: 1fr;
  }

  .terms-strip > div + div {
    padding: 14px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 680px) {
  .page-shell {
    padding: 0 14px 24px;
  }

  .topbar {
    min-height: 66px;
  }

  .topbar-meta span {
    display: none;
  }

  .hero {
    padding: 35px 0 28px;
    gap: 24px;
  }

  .hero-copy {
    font-size: 15px;
  }

  .phase-nav {
    grid-template-columns: repeat(4, auto);
    overflow-x: auto;
  }

  .phase-item {
    min-width: 52px;
    padding: 7px;
    justify-content: center;
  }

  .phase-item b {
    display: none;
  }

  .wizard-card {
    min-height: 540px;
    border-radius: 18px;
  }

  .question-panel,
  .result-panel {
    padding: 36px 22px 30px;
  }

  .answer-grid {
    grid-template-columns: 1fr;
    margin-top: 28px;
  }

  .answer-button {
    min-height: 104px;
  }

  .number-form > div,
  .result-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .number-form button {
    min-height: 50px;
  }

  .estimate-lines {
    display: block;
  }

  .wizard-footer {
    padding-inline: 20px;
  }

  .terms-strip {
    padding: 18px;
  }
}

@media print {
  body {
    background: white;
  }

  .page-shell {
    padding: 0;
  }

  .topbar,
  .hero,
  .phase-nav,
  .estimate-card,
  .wizard-footer,
  .result-actions,
  .terms-strip,
  .progress-row,
  .progress-track {
    display: none !important;
  }

  .workspace {
    display: block;
  }

  .wizard-card {
    min-height: 0;
    border: 0;
    box-shadow: none;
  }

  .result-panel {
    padding: 0;
  }
}
