:root {
  --bg: #f4f6f3;
  --card: #ffffff;
  --text: #111312;
  --muted: #626a66;
  --soft: #e7ebe7;
  --line: #d9dfda;
  --brand: #1f827f;
  --brand-dark: #12605f;
  --accent: #b4c7a8;
  --ink: #070807;
  --danger: #b42318;
  --shadow: 0 26px 70px rgba(15, 35, 32, 0.14);
  --ui-scale: 1;
  --shell-pad: clamp(10px, 2.2vw, 42px);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 8%, rgba(31, 130, 127, 0.12), transparent 28%),
    linear-gradient(145deg, #f8faf7 0%, var(--bg) 46%, #eef2eb 100%);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--shell-pad);
  overflow: hidden;
}

.quote-card {
  width: min(1180px, 100%);
  min-height: min(760px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.8vh, 22px);
  padding: clamp(16px, 2.6vw, 34px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(17, 19, 18, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  transform: scale(var(--ui-scale));
  transform-origin: center;
}

.quote-header,
.form-actions,
.download-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mini-label {
  margin: 0;
  color: var(--brand-dark);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  color: var(--ink);
}

h1 {
  font-size: clamp(0.96rem, 1.8vw, 1.7rem);
  line-height: 1.06;
  text-align: right;
  text-transform: uppercase;
}

h2 {
  margin-top: clamp(4px, 1.2vh, 12px);
  font-size: clamp(1.35rem, 2.65vw, 2.45rem);
  line-height: 1.08;
}

.brand-lockup {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  width: clamp(104px, 13vw, 162px);
  height: auto;
  display: block;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(6px, 1vw, 10px);
}

.timeline-step {
  position: relative;
  min-height: clamp(44px, 6vh, 56px);
  display: grid;
  grid-template-columns: clamp(28px, 3vw, 32px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(6px, 0.8vw, 9px);
  padding: clamp(6px, 1vh, 8px) clamp(8px, 1vw, 10px);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9f6;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.timeline-step:hover {
  color: var(--ink);
  border-color: var(--brand);
  background: #eef8f6;
  transform: translateY(-1px);
}

.timeline-step::after {
  content: "";
  position: absolute;
  left: clamp(38px, 4vw, 42px);
  right: 10px;
  bottom: 8px;
  display: block;
  height: 3px;
  border-radius: 999px;
  background: #e1e6e1;
}

.timeline-step span {
  width: clamp(28px, 3vw, 32px);
  height: clamp(28px, 3vw, 32px);
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid #cfd7d1;
  border-radius: 50%;
  background: #fff;
  font-weight: 800;
}

.timeline-step strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.85rem;
  line-height: 1.15;
  text-overflow: ellipsis;
}

.timeline-step.is-active {
  color: var(--ink);
  border-color: rgba(31, 130, 127, 0.5);
  background: #f2faf8;
}

.timeline-step.is-active::after {
  background: var(--brand);
}

.timeline-step.is-active span {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.layout-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.58fr);
  gap: clamp(14px, 2.4vw, 34px);
  min-height: 0;
}

.quote-card.is-final .layout-grid {
  grid-template-columns: minmax(0, 1fr);
}

.quote-card.is-final .visual-panel {
  display: none;
}

.quote-card.is-final .step-panel {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.quote-card.is-final #next-step {
  display: none;
}

.quote-card.is-final #prev-step {
  display: none;
}

.visual-panel,
.step-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.visual-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(12px, 2vh, 24px);
  padding: clamp(10px, 1.5vw, 18px) clamp(18px, 2.4vw, 28px) clamp(18px, 2.4vw, 28px);
  color: #f8fbf7;
  background:
    linear-gradient(rgba(9, 18, 16, 0.48), rgba(9, 18, 16, 0.7)),
    linear-gradient(135deg, #1f827f, #26352d 52%, #0d1110);
  overflow: hidden;
  position: relative;
}

.visual-panel::after {
  content: "";
  position: absolute;
  inset: auto -18% -22% 26%;
  height: 220px;
  background: rgba(180, 199, 168, 0.22);
  transform: rotate(-12deg);
}

.answer-panel,
.side-answers {
  position: relative;
  z-index: 1;
}

.answer-panel {
  padding: clamp(12px, 1.8vw, 18px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(7, 8, 7, 0.22);
}

.answer-panel .mini-label {
  font-size: 0.92rem;
}

.side-answers {
  display: grid;
  gap: clamp(6px, 1vh, 10px);
  margin: clamp(8px, 1.4vh, 14px) 0 0;
}

.side-answers div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: clamp(6px, 1vh, 10px);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.side-answers dt {
  color: rgba(255, 255, 255, 0.7);
}

.side-answers dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.answer-note {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.45;
}

.step-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(14px, 2.2vw, 30px);
}

.step {
  display: none;
  animation: fadeIn 180ms ease both;
}

.step.is-current {
  display: block;
}

.step-help {
  max-width: 720px;
  margin: clamp(6px, 1vh, 10px) 0 clamp(14px, 2.3vh, 26px);
  color: var(--muted);
  line-height: 1.55;
}

.field-group,
.radio-list {
  min-width: 0;
  margin: 0 0 clamp(12px, 2vh, 22px);
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: clamp(8px, 1.2vh, 12px);
  color: var(--muted);
  font-weight: 700;
}

.choice-grid {
  display: grid;
  gap: clamp(10px, 1.5vh, 14px);
}

.choice-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-card {
  position: relative;
  min-height: clamp(104px, 16vh, 138px);
  display: grid;
  gap: 8px;
  align-content: center;
  justify-items: center;
  padding: clamp(12px, 1.7vw, 18px);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.choice-card:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
  background: #f2faf8;
}

.choice-card input,
.radio-list input,
.toggle-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-card:has(input:checked) {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand), 0 12px 28px rgba(31, 130, 127, 0.1);
  background: #f7fbfa;
}

.choice-card small {
  color: var(--muted);
  line-height: 1.35;
}

.choice-icon {
  position: relative;
  width: clamp(28px, 3vw, 34px);
  height: clamp(28px, 3vw, 34px);
  color: var(--brand);
}

.window-icon,
.sliding-icon {
  border: 3px solid currentColor;
  border-radius: 4px;
}

.window-icon::before,
.sliding-icon::before {
  content: "";
  position: absolute;
  inset: 0 47% 0 auto;
  width: 3px;
  background: currentColor;
}

.door-icon {
  border-left: 4px solid currentColor;
  border-bottom: 4px solid currentColor;
}

.door-icon::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  width: 18px;
  height: 30px;
  border: 3px solid currentColor;
  border-radius: 4px 4px 0 0;
}

.folding-icon {
  border-bottom: 4px solid currentColor;
}

.folding-icon::before,
.folding-icon::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 16px;
  height: 30px;
  border: 3px solid currentColor;
}

.folding-icon::before {
  left: 1px;
  transform: skewY(-12deg);
}

.folding-icon::after {
  right: 1px;
  transform: skewY(12deg);
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.7vh, 16px);
}

.span-all {
  grid-column: 1 / -1;
}

.input-field {
  display: grid;
  gap: clamp(5px, 0.8vh, 8px);
  color: var(--muted);
  font-weight: 700;
}

.input-field input,
.input-field select {
  width: 100%;
  min-height: clamp(44px, 6.1vh, 56px);
  padding: 0 clamp(14px, 1.6vw, 18px);
  color: var(--ink);
  border: 1px solid #cfd7d1;
  border-radius: 999px;
  background: #fbfcfb;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input-field input:focus,
.input-field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(31, 130, 127, 0.12);
}

.input-field input:user-invalid,
.toggle-field input:user-invalid + span {
  border-color: var(--danger);
}

.radio-list {
  display: grid;
  gap: clamp(10px, 1.5vh, 14px);
}

.radio-list label,
.toggle-field {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: clamp(12px, 1.7vw, 16px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  cursor: pointer;
}

.radio-list.compact label {
  max-width: 420px;
}

.radio-list label > span,
.toggle-field::before {
  width: 26px;
  height: 26px;
  border: 2px solid #cfd7d1;
  border-radius: 50%;
  background: #fff;
}

.radio-list label:has(input:checked) {
  border-color: var(--brand);
  background: #f7fbfa;
}

.radio-list label:has(input:checked) > span {
  border: 8px solid var(--ink);
}

.radio-list strong,
.radio-list small {
  grid-column: 2;
}

.radio-list small {
  margin-top: -10px;
  color: var(--muted);
  line-height: 1.4;
}

.toggle-field {
  align-items: center;
  color: var(--ink);
  font-weight: 700;
}

.toggle-field::before {
  content: "";
  border-radius: 8px;
}

.toggle-field:has(input:checked)::before {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: inset 0 0 0 5px #fff;
}

.result-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: clamp(14px, 1.8vw, 18px);
  color: #fff;
  background: linear-gradient(135deg, var(--brand-dark), #111815);
  border-radius: 8px;
}

.result-box span {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.result-box strong {
  font-size: clamp(1.45rem, 2.3vw, 2rem);
}

.result-box p {
  max-width: 280px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.45;
}

.summary-list {
  display: grid;
  gap: 0;
  margin: clamp(8px, 1.4vh, 14px) 0 0;
  border-top: 1px solid var(--line);
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(5px, 0.9vh, 8px) 0;
  border-bottom: 1px solid var(--line);
}

.summary-list dt {
  color: var(--muted);
}

.summary-list dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.contact-grid {
  margin-top: 4px;
}

.final-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.92fr);
  gap: clamp(14px, 2vw, 24px);
  align-items: start;
  margin-top: clamp(10px, 1.8vh, 18px);
}

.final-column {
  min-width: 0;
}

.contact-column {
  padding: clamp(14px, 1.8vw, 18px);
  border: 1px solid #d5ddd5;
  border-radius: 8px;
  background: #f0f3f0;
}

.contact-column h3 {
  margin: 0 0 clamp(10px, 1.5vh, 16px);
  color: var(--ink);
  font-size: 1.1rem;
}

.contact-column .input-grid {
  grid-template-columns: 1fr;
}

.consent {
  grid-template-columns: 28px minmax(0, 1fr);
  padding: 14px 0;
  border: 0;
  background: transparent;
}

.form-actions {
  margin-top: auto;
  padding-top: clamp(12px, 2vh, 24px);
}

.primary-action,
.secondary-action,
.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  padding: 0 clamp(18px, 2vw, 24px);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, opacity 150ms ease, box-shadow 150ms ease;
}

.primary-action {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.secondary-action {
  color: var(--ink);
  background: #e9eee9;
}

.ghost-action {
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
}

.primary-action:hover,
.secondary-action:hover,
.ghost-action:hover {
  transform: translateY(-1px);
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 10px 24px rgba(31, 130, 127, 0.2);
}

.ghost-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.download-row {
  margin-top: clamp(10px, 1.8vh, 18px);
}

.success-message {
  min-height: 24px;
  margin: clamp(8px, 1.2vh, 12px) 0 0;
  color: var(--brand-dark);
  font-weight: 800;
}

.thanks-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--shell-pad);
}

.thanks-card {
  width: min(760px, 100%);
  padding: clamp(22px, 4.5vw, 54px);
  border: 1px solid rgba(17, 19, 18, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.thanks-card .brand-logo {
  margin-bottom: clamp(18px, 3vh, 34px);
}

.thanks-card h1 {
  max-width: 620px;
  margin-bottom: clamp(10px, 1.8vh, 16px);
  font-size: clamp(1.7rem, 3.5vw, 3.4rem);
  text-align: left;
  text-transform: none;
}

.thanks-card p {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  line-height: 1.6;
}

.folio-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: clamp(18px, 3vh, 28px) 0;
  padding: clamp(14px, 1.8vw, 18px);
  border: 1px solid #d5ddd5;
  border-radius: 8px;
  background: #f0f3f0;
}

.folio-box span {
  color: var(--muted);
  font-weight: 700;
}

.folio-box strong {
  color: var(--brand-dark);
  font-size: 1.2rem;
}

.thanks-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(18px, 2.8vh, 26px);
}

@media (min-width: 760px) and (min-height: 560px) {
  body {
    overflow: hidden;
  }

  .app-shell,
  .thanks-shell {
    height: 100dvh;
    min-height: 100dvh;
  }
}

@media (max-height: 760px) and (min-width: 760px) {
  body {
    font-size: 0.94rem;
  }

  .quote-card {
    min-height: 0;
  }

  .answer-note,
  .step-help,
  .radio-list small,
  .choice-card small,
  .result-box p {
    line-height: 1.35;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (max-width: 900px) {
  .app-shell {
    align-items: start;
    padding: 12px;
  }

  .quote-card {
    min-height: calc(100vh - 24px);
  }

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

  .visual-panel {
    min-height: 0;
    display: grid;
    grid-template-columns: 0.8fr 1fr;
    align-items: center;
  }

  .answer-panel {
    grid-column: 1 / -1;
  }

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

@media (max-width: 640px) {
  .quote-header,
  .form-actions,
  .download-row,
  .result-box,
  .summary-list div {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-header {
    gap: 10px;
  }

  .brand-lockup {
    align-self: flex-start;
  }

  h1 {
    text-align: left;
  }

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

  .timeline-step {
    min-height: 48px;
  }

  .visual-panel,
  .choice-grid.two,
  .input-grid {
    grid-template-columns: 1fr;
  }

  .visual-panel {
    gap: 16px;
  }

  .span-all {
    grid-column: auto;
  }

  .side-answers div,
  .summary-list div {
    display: grid;
    gap: 4px;
  }

  .side-answers dd,
  .summary-list dd {
    text-align: left;
  }

  .primary-action,
  .secondary-action,
  .ghost-action {
    width: 100%;
  }
}
