:root {
  color-scheme: light;
  --ink: #17304a;
  --muted: #627386;
  --line: #dce4eb;
  --paper: #ffffff;
  --soft: #f4f8fb;
  --brand: #1c6689;
  --brand-strong: #124965;
  --accent: #f2a92c;
  --success: #13795b;
  --danger: #b44336;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(19, 49, 75, 0.7), rgba(19, 49, 75, 0.7)),
    radial-gradient(circle at 10% 0%, #42789d 0, transparent 34%),
    linear-gradient(135deg, #17304a 0%, #245274 55%, #17304a 100%);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  align-items: center;
}

.calculator {
  background: var(--paper);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(6, 24, 40, 0.26);
  overflow: hidden;
}

.calculator__top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
  padding: 34px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--ink);
  line-height: 1.05;
}

h1 {
  max-width: 660px;
  font-size: clamp(2rem, 5vw, 3.8rem);
}

h2 {
  font-size: clamp(2.2rem, 8vw, 4.8rem);
}

.subtitle {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.55;
}

.top-actions {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.insurance-card {
  min-width: 230px;
  padding: 18px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}

.insurance-card span,
.insurance-card strong {
  display: block;
}

.insurance-card span {
  font-weight: 800;
}

.insurance-card strong {
  margin-top: 4px;
  font-size: 1.35rem;
}

.telegram-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.quote-form {
  padding: 30px 34px 34px;
}

.field-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.field-group legend,
.field span {
  display: block;
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 800;
}

.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--line);
  gap: 1px;
}

.vehicle-card {
  min-height: 132px;
  padding: 18px 12px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  background: #fbfdff;
  color: #7b8897;
  cursor: pointer;
  text-align: center;
  font-weight: 800;
  text-transform: uppercase;
}

.vehicle-card input,
.auction-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vehicle-card__icon {
  display: grid;
  place-items: center;
  width: 74px;
  height: 42px;
  border-radius: 999px;
  background: #edf4f8;
  color: var(--brand);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.vehicle-card:has(input:checked) {
  background: #f0f8fc;
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  color: var(--ink);
}

.vehicle-card:has(input:focus-visible),
.auction-switch label:has(input:focus-visible),
.submit-button:focus-visible,
.telegram-link:focus-visible,
.field input:focus-visible {
  outline: 3px solid rgba(242, 169, 44, 0.65);
  outline-offset: 3px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(280px, 1fr);
  gap: 22px;
  align-items: end;
  margin-top: 30px;
}

.field-group--compact legend {
  margin-bottom: 12px;
}

.auction-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auction-switch label span {
  display: grid;
  min-height: 58px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.auction-switch label:has(input:checked) span {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.field input {
  width: 100%;
  height: 58px;
  padding: 0 16px;
  border: 1px solid #c8d3dd;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.submit-button {
  width: 100%;
  min-height: 60px;
  margin-top: 22px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #261800;
  font-weight: 900;
  cursor: pointer;
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.status {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.status--error {
  color: var(--danger);
}

.result {
  margin: 0 34px 34px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbfd 0%, #ffffff 100%);
}

.result__head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.port-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: #eaf6f1;
  color: var(--success);
  font-weight: 900;
  white-space: nowrap;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 18px 0 22px;
  background: var(--line);
  border: 1px solid var(--line);
}

.summary div {
  min-width: 0;
  padding: 16px;
  background: #fff;
}

.summary dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.summary dd {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.price-lines {
  display: grid;
  gap: 0;
}

.price-lines div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.price-lines strong {
  font-size: 1.08rem;
}

.result-note {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 860px) {
  .shell {
    width: 100%;
    padding: 0;
    align-items: start;
  }

  .calculator {
    min-height: 100svh;
    border-radius: 0;
    box-shadow: none;
  }

  .calculator__top {
    grid-template-columns: 1fr;
    padding: 24px 18px;
  }

  .telegram-link {
    width: 100%;
  }

  .top-actions {
    justify-items: stretch;
  }

  .insurance-card {
    min-width: 0;
  }

  .quote-form {
    padding: 22px 18px;
  }

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

  .vehicle-card {
    min-height: 112px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    margin-top: 22px;
  }

  .result {
    margin: 0 18px 22px;
    padding: 20px;
  }

  .result__head {
    display: grid;
  }

  .port-badge {
    justify-self: start;
  }

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

@media (max-width: 420px) {
  .calculator__top {
    padding: 22px 14px;
  }

  .quote-form {
    padding: 20px 14px;
  }

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

  .vehicle-card {
    min-height: 86px;
    grid-template-columns: 72px 1fr;
    justify-items: start;
    text-align: left;
  }

  .auction-switch {
    grid-template-columns: 1fr;
  }

  .result {
    margin-inline: 14px;
  }
}
