.cost-estimator {
  max-width: 1120px;
  margin: 0 auto;
  padding-top: clamp(72px, 10vw, 128px);
  padding-bottom: clamp(88px, 12vw, 152px);
}

.cost-estimator > .section__label,
.cost-estimator > .section__title,
.cost-estimator > .section__subtitle {
  max-width: 860px;
}

.cost-estimator > .section__title {
  margin-top: 0;
  text-wrap: balance;
}

.cost-estimator > .section__subtitle {
  margin-top: var(--space-4);
  color: var(--text-secondary);
  text-wrap: pretty;
}

.cost-estimator__inputs {
  display: grid;
  grid-template-columns: 1fr 1.5fr .75fr;
  gap: var(--space-4);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 2px solid var(--text-primary);
}

.cost-estimator__field label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 600;
}

.cost-estimator__control {
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  background: var(--surface-primary);
  color: var(--text-primary);
  font: inherit;
}

.cost-estimator__control:disabled {
  background: var(--surface-secondary);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.cost-estimator__control:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cost-estimator__quantity {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
}

.cost-estimator__quantity span {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.cost-estimator__error {
  min-height: 1.5em;
  margin-top: 6px;
  color: var(--accent);
  font-size: var(--text-xs);
}

.country-other {
  display: grid;
  grid-template-columns: minmax(160px, .6fr) minmax(0, 1fr);
  align-items: end;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.country-other[hidden] {
  display: none;
}

.country-other__input {
  width: 100%;
  min-height: 48px;
  padding: 10px 2px;
  border: 0;
  border-bottom: 2px solid var(--text-primary);
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
}

.country-other__input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.country-other__input[aria-invalid="true"] {
  border-bottom-color: var(--accent);
}

.country-selector__error {
  min-height: 1.5em;
  margin: 6px 0 0;
  color: var(--accent);
  font-size: var(--text-xs);
}

.cost-result {
  margin-top: var(--space-7);
  padding: clamp(24px, 4vw, 48px);
  border-top: 2px solid var(--text-primary);
  background: var(--surface-secondary);
}

.cost-result h2,
.service-choice h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.cost-result__badge {
  display: inline-flex;
  margin-left: var(--space-2);
  padding: 3px 8px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0;
  vertical-align: middle;
}

.cost-result__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: var(--space-5);
  border-block: 1px solid var(--border);
}

.cost-result__grid[hidden] {
  display: none;
}

.cost-result__item {
  min-width: 0;
  padding: var(--space-4);
  border-right: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.cost-result__item:first-child {
  padding-left: 0;
}

.cost-result__item:last-child {
  padding-right: 0;
  border-right: 0;
}

.cost-result__value {
  display: block;
  margin-top: var(--space-2);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.cost-result__difference .cost-result__value {
  color: var(--accent);
}

.cost-result__message {
  margin-top: var(--space-4);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 500;
}

.cost-result__boundary {
  max-width: 900px;
  margin-top: var(--space-4);
  padding-left: var(--space-3);
  border-left: 2px solid var(--accent);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: 1.7;
  text-wrap: pretty;
}

.service-choice {
  margin-top: clamp(72px, 10vw, 120px);
}

.service-choice__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: var(--space-6);
  border-block: 1px solid var(--border);
}

.service-choice__option {
  position: relative;
}

.service-choice__option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.service-choice__option label {
  display: flex;
  min-height: 184px;
  flex-direction: column;
  padding: var(--space-4);
  border-top: 4px solid transparent;
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.service-choice__option:last-child label {
  border-right: 0;
}

.service-choice__option label:hover {
  background: var(--surface-secondary);
}

.service-choice__option input:checked + label {
  border-top-color: var(--accent);
  background: #FFF4F4;
}

.service-choice__option input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.service-choice__option label:active {
  transform: translateY(1px);
}

.service-choice__name {
  display: block;
  margin-bottom: var(--space-3);
  color: var(--text-primary);
  font-size: var(--text-md);
  font-weight: 600;
}

.service-choice__summary {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.65;
}

[data-service-hint] {
  margin: var(--space-4) 0 var(--space-3);
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.service-choice__cta {
  margin-top: var(--space-3);
}

.service-choice__cta[aria-disabled="true"] {
  pointer-events: none;
  opacity: .52;
}

@media (max-width: 900px) {
  .cost-estimator__inputs {
    grid-template-columns: 1fr 1fr;
  }

  .cost-estimator__field:last-child {
    grid-column: 1 / -1;
    max-width: 360px;
  }

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

  .service-choice__option:nth-child(2n) label {
    border-right: 0;
  }

  .service-choice__option:nth-child(n + 3) label {
    border-top-color: var(--border);
  }

  .service-choice__option input:checked + label {
    border-top-color: var(--accent);
  }
}

@media (max-width: 640px) {
  .cost-estimator {
    padding-inline: var(--grid-margin);
  }

  .cost-estimator__inputs,
  .cost-result__grid,
  .service-choice__grid {
    grid-template-columns: 1fr;
  }

  .country-other {
    grid-template-columns: 1fr;
  }

  .cost-estimator__field:last-child {
    grid-column: auto;
    max-width: none;
  }

  .cost-result {
    padding-inline: var(--space-4);
  }

  .cost-result__badge {
    margin: var(--space-2) 0 0;
  }

  .cost-result__item,
  .cost-result__item:first-child,
  .cost-result__item:last-child {
    padding: var(--space-4) 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .cost-result__item:last-child {
    border-bottom: 0;
  }

  .service-choice__option label,
  .service-choice__option:nth-child(2n) label {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .service-choice__option:last-child label {
    border-bottom: 0;
  }
}
