:root {
  --primary: #082b3c;
  --primary-soft: #e8eef0;
  --text: #18272e;
  --muted: #657179;
  --border: #d9dddf;
  --surface: #ffffff;
  --page: #082b3c;
  --danger: #c03535;
  --radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--page);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--page);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.page-shell {
  width: 100%;
  min-height: 100vh;
  padding: 46px 24px 64px;
}

.page-intro {
  max-width: 1152px;
  margin: 0 auto 48px;
  text-align: center;
  color: #fff;
}

.page-intro h1 {
  margin: 0 0 14px;
  font-size: clamp(2.15rem, 3.2vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.page-intro p {
  max-width: 680px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.08rem;
  line-height: 1.55;
}

.calculator {
  width: min(1152px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.22);
}

.progress-wrap {
  padding: 32px 24px 25px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  color: #536068;
  font-size: 0.875rem;
  font-weight: 600;
}

.mobile-track {
  display: none;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f1;
}

.mobile-track span {
  display: block;
  height: 100%;
  background: var(--primary);
  transition: width 280ms ease;
}

.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin: 0 13px;
}

.steps::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  left: 12px;
  height: 6px;
  background: #edf0f1;
}

.steps-progress {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  height: 6px;
  background: var(--primary);
  transition: width 280ms ease;
}

.step-indicator {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #758189;
  font-size: 0.7rem;
  cursor: pointer;
}

.step-indicator:disabled {
  cursor: not-allowed;
}

.step-indicator .dot {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #edf0f1;
  color: #304047;
  font-size: 0.65rem;
  font-weight: 800;
}

.step-indicator.is-active .dot {
  outline: 4px solid rgba(8, 43, 60, 0.15);
  background: var(--primary);
  color: #fff;
}

.step-indicator.is-done .dot {
  background: var(--primary);
  color: #fff;
}

.step-indicator .label {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-root {
  min-height: 600px;
}

.step-layout {
  display: flex;
  min-height: 600px;
  background: var(--surface);
  animation: enter 260ms ease both;
}

.step-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 46px 48px;
}

.step-content h2 {
  margin: 0 0 14px;
  color: var(--primary);
  font-size: clamp(1.75rem, 2.4vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.step-description {
  max-width: 470px;
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

.step-photo {
  position: relative;
  width: 33.333%;
  min-width: 330px;
  overflow: hidden;
  background: #e7eaeb;
}

.step-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.14), transparent 28%), rgba(8,43,60,0.08);
  pointer-events: none;
}

.step-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.option-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 32px;
}

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

.option-card {
  position: relative;
  display: flex;
  min-height: 160px;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.option-card:hover {
  border-color: #748a94;
}

.option-card.is-selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.option-top {
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.option-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
}

.is-selected .option-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.option-icon svg {
  width: 24px;
  height: 24px;
}

.selected-mark {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  font-weight: 900;
}

.option-card h3 {
  margin: 0 0 4px;
  font-size: 1.08rem;
  font-weight: 600;
}

.option-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.option-card.is-selected p {
  color: rgba(255, 255, 255, 0.8);
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.actions.end {
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, opacity 150ms ease;
}

.button:hover:not(:disabled) {
  background: #123d50;
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.button.ghost {
  padding-inline: 20px;
  background: transparent;
  color: var(--text);
}

.button.ghost:hover {
  background: var(--primary);
  color: #fff;
}

.button.outline {
  border-color: var(--primary);
  background: #fff;
  color: var(--primary);
}

.button.outline:hover {
  background: var(--primary-soft);
}

.rooms-builder {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.875rem;
  font-weight: 700;
}

.room-types {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 24px;
}

.room-type {
  min-height: 44px;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.83rem;
  font-weight: 650;
  cursor: pointer;
}

.room-type.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.range-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.range-value {
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 800;
}

.area-range {
  width: 100%;
  accent-color: var(--primary);
}

.range-limits {
  display: flex;
  justify-content: space-between;
  margin: 5px 0 18px;
  color: var(--muted);
  font-size: 0.75rem;
}

.add-room {
  width: 100%;
  border-radius: 8px;
}

.room-list {
  margin: 22px 0 28px;
}

.room-list h3 {
  margin: 0 0 10px;
  font-size: 0.875rem;
}

.room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
}

.room-row + .room-row {
  margin-top: 8px;
}

.room-row h4,
.room-row p {
  margin: 0;
}

.room-row h4 {
  font-size: 0.9rem;
}

.room-row p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--danger);
  font-size: 1.2rem;
  cursor: pointer;
}

.empty-note {
  margin: 18px 0 24px;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

.radio-section + .radio-section {
  margin-top: 28px;
}

.radio-section h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.radio-list {
  display: grid;
  gap: 10px;
}

.radio-row {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.radio-row:hover {
  background: #f7f9f9;
}

.radio-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

.installation-form {
  max-height: 450px;
  margin-bottom: 28px;
  padding-right: 4px;
  overflow-y: auto;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 22px;
  margin-bottom: 30px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.84rem;
  font-weight: 650;
}

.field input {
  width: 100%;
  height: 40px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  outline: 0;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 43, 60, 0.12);
}

.field input.is-invalid {
  border-color: var(--danger);
}

.error {
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 0.78rem;
}

.submit-error {
  margin: 0 0 16px;
  color: var(--danger);
  font-size: 0.84rem;
}

.contact-actions {
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}

.result-card {
  padding: 24px;
  border: 1px solid var(--border);
  background: #fff;
}

.result-card.price {
  position: relative;
  border: 2px solid var(--primary);
  box-shadow: 0 7px 16px rgba(8, 43, 60, 0.12);
}

.result-card.price::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: var(--primary);
}

.result-card h3 {
  margin: 0 0 18px;
  color: var(--primary);
  font-size: 1.13rem;
}

.summary-line,
.price-line,
.room-detail {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.summary-line,
.price-line {
  padding: 7px 0;
  font-size: 0.875rem;
}

.summary-line span:first-child,
.price-line span:first-child,
.room-detail {
  color: var(--muted);
}

.rule {
  height: 1px;
  margin: 12px 0;
  background: var(--border);
}

.details-title {
  margin: 12px 0 8px;
  font-size: 0.82rem;
}

.room-detail {
  padding: 4px 0;
  font-size: 0.76rem;
}

.total-line {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--primary);
  font-weight: 800;
}

.total-line strong {
  font-size: 1.45rem;
}

.range-price {
  margin-top: 14px;
  padding: 11px;
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 650;
  text-align: center;
}

.disclaimer {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@media (max-width: 1023px) {
  .step-photo {
    display: none;
  }

  .step-content {
    padding: 40px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 28px 14px 40px;
  }

  .page-intro {
    margin-bottom: 28px;
  }

  .page-intro h1 {
    font-size: 2rem;
  }

  .page-intro p {
    font-size: 0.96rem;
  }

  .progress-wrap {
    padding: 24px 20px;
  }

  .mobile-track {
    display: block;
  }

  .steps {
    display: none;
  }

  .step-root,
  .step-layout {
    min-height: 580px;
  }

  .step-content {
    justify-content: flex-start;
    padding: 30px 22px;
  }

  .step-content h2 {
    font-size: 1.7rem;
  }

  .option-grid.two,
  .contact-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

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

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

  .actions,
  .contact-actions {
    align-items: stretch;
  }

  .button {
    min-height: 48px;
  }

  .result-actions {
    flex-direction: column;
  }
}

@media print {
  body {
    background: #fff;
  }

  .page-intro,
  #progress,
  .step-photo,
  .result-actions,
  .disclaimer {
    display: none !important;
  }

  .page-shell,
  .step-content {
    padding: 0;
  }

  .calculator {
    width: 100%;
    box-shadow: none;
  }
}
