:root {
  --ink: #252c19;
  --gray: #858585;
  --silver: #707070;
  --white: #fff;
  --line: rgba(32, 31, 34, .18);
  --page-x: clamp(24px, 5.555vw, 80px);
  --font: "Inter", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.is-modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { color: inherit; font: inherit; }
button { border: 0; cursor: pointer; }
[hidden] { display: none !important; }

.calculator-header {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: clamp(24px, 2.5vw, 48px) var(--page-x) 0;
}
.calculator-brand { display: inline-flex; align-items: baseline; gap: 8px; font-size: clamp(21px, 1.6vw, 31px); font-weight: 500; line-height: 1; letter-spacing: -.055em; }
.calculator-brand small { font-size: .38em; letter-spacing: .16em; }
.calculator-close { position: relative; display: grid; width: clamp(48px, 3.1vw, 60px); height: clamp(48px, 3.1vw, 60px); place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.calculator-close span { position: absolute; width: 21px; height: 1px; background: currentColor; }
.calculator-close span:first-child { transform: rotate(45deg); }
.calculator-close span:last-child { transform: rotate(-45deg); }

.calculator-page { padding: clamp(65px, 6vw, 116px) var(--page-x) clamp(80px, 7vw, 135px); }
.calculator-intro { display: grid; grid-template-columns: minmax(220px, .72fr) minmax(0, 1.28fr); gap: clamp(45px, 8vw, 150px); align-items: start; }
.calculator-index { color: var(--gray); font-size: 14px; }
.calculator-index span { letter-spacing: .06em; }
.calculator-index p { margin: 12px 0 0; }
.calculator-copy h1 { margin: 0; font-size: clamp(52px, 5.45vw, 104px); font-weight: 400; line-height: .92; letter-spacing: -.065em; }
.calculator-copy h1 span { color: #aaa; }
.calculator-copy > p { max-width: 630px; margin: 32px 0 0; color: var(--gray); font-size: clamp(16px, 1.05vw, 20px); line-height: 1.45; }

.calculator-workspace { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(430px, .98fr); gap: clamp(20px, 2vw, 38px); margin-top: clamp(65px, 6vw, 116px); align-items: start; }
.calculator-controls { border-top: 1px solid var(--ink); }
.calculator-group { min-width: 0; margin: 0; padding: clamp(25px, 2vw, 38px) 0; border: 0; border-bottom: 1px solid var(--line); }
.calculator-group legend { display: flex; width: 100%; align-items: center; gap: 18px; padding: 0; font-size: 15px; font-weight: 500; }
.calculator-group legend span { color: var(--gray); font-size: 12px; font-weight: 400; }

.unit-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 22px; }
.unit-option { position: relative; cursor: pointer; }
.unit-option input { position: absolute; opacity: 0; pointer-events: none; }
.unit-option > span { display: flex; min-height: 122px; flex-direction: column; justify-content: space-between; padding: 17px; border: 1px solid var(--line); transition: color 180ms ease, background 180ms ease, border-color 180ms ease; }
.unit-option small { color: var(--gray); font-size: 12px; }
.unit-option strong { margin-top: auto; font-size: clamp(25px, 1.8vw, 35px); font-weight: 400; letter-spacing: -.045em; }
.unit-option em { margin-top: 4px; font-size: 12px; font-style: normal; }
.unit-option input:checked + span { color: var(--white); border-color: var(--ink); background: var(--ink); }
.unit-option input:checked + span small { color: #c5c7b9; }
.unit-option input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }

.range-value { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 19px; }
.range-value strong { font-size: clamp(38px, 3.2vw, 62px); font-weight: 400; line-height: 1; letter-spacing: -.055em; }
.range-value span { padding-bottom: 5px; color: var(--gray); font-size: 14px; }
.calculator-range { width: 100%; height: 28px; margin: 17px 0 0; appearance: none; background: transparent; cursor: pointer; }
.calculator-range::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--ink) 0 var(--range-fill, 0%), #d8d8d8 var(--range-fill, 0%) 100%); }
.calculator-range::-moz-range-track { height: 2px; background: #d8d8d8; }
.calculator-range::-moz-range-progress { height: 2px; background: var(--ink); }
.calculator-range::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -10px; appearance: none; border: 6px solid var(--white); border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.calculator-range::-moz-range-thumb { width: 12px; height: 12px; border: 5px solid var(--white); border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.range-scale { display: flex; justify-content: space-between; color: var(--gray); font-size: 11px; }

.month-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 22px; }
.month-options label { position: relative; cursor: pointer; }
.month-options input { position: absolute; opacity: 0; pointer-events: none; }
.month-options label > span { display: inline; font-size: 19px; }
.month-options label > small { margin-left: 4px; font-size: 11px; }
.month-options label::after { position: absolute; inset: 0; z-index: -1; border: 1px solid var(--line); content: ""; }
.month-options label { z-index: 0; min-height: 54px; padding: 17px 10px; text-align: center; }
.month-options label:has(input:checked) { color: var(--white); }
.month-options label:has(input:checked)::after { border-color: var(--ink); background: var(--ink); }
.month-options input:focus-visible ~ span { outline: 2px solid var(--ink); outline-offset: 8px; }
.calculator-group.is-locked { opacity: .28; pointer-events: none; }

.cash-option { display: flex; align-items: center; gap: 15px; padding: 25px 0; border-bottom: 1px solid var(--ink); cursor: pointer; }
.cash-option input { position: absolute; opacity: 0; pointer-events: none; }
.cash-option__toggle { position: relative; width: 48px; height: 27px; flex: 0 0 auto; border-radius: 999px; background: #ddd; transition: background 180ms ease; }
.cash-option__toggle i { position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: var(--white); transition: transform 180ms ease; }
.cash-option input:checked + .cash-option__toggle { background: var(--ink); }
.cash-option input:checked + .cash-option__toggle i { transform: translateX(21px); }
.cash-option > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.cash-option strong { font-size: 15px; font-weight: 500; }
.cash-option small { color: var(--gray); font-size: 12px; }

.calculator-result { position: sticky; top: 24px; overflow: hidden; padding: clamp(28px, 3vw, 54px); color: var(--white); background: var(--ink); }
.calculator-result::after { position: absolute; top: -145px; right: -120px; width: 360px; height: 360px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 46px rgba(255,255,255,.025), 0 0 0 92px rgba(255,255,255,.02); content: ""; pointer-events: none; }
.result-head { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,.2); }
.result-head p { margin: 0; color: #c5c7b9; font-size: 13px; }
.result-head > span { padding: 8px 12px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; font-size: 11px; }
.result-primary { position: relative; z-index: 1; padding: clamp(30px, 3vw, 54px) 0; }
.result-primary > span { display: block; color: #c5c7b9; font-size: 13px; }
.result-primary strong { display: block; margin-top: 12px; font-size: clamp(54px, 5vw, 96px); font-weight: 400; line-height: .92; letter-spacing: -.065em; white-space: nowrap; }
.result-primary small { display: block; margin-top: 13px; color: #c5c7b9; font-size: 13px; }
.result-primary small b { color: var(--white); font-weight: 400; }
.result-primary--cash strong { max-width: 560px; font-size: clamp(42px, 3.8vw, 72px); white-space: normal; }

.result-details { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; margin: 0; border-top: 1px solid rgba(255,255,255,.2); }
.result-details div { min-width: 0; padding: 18px 12px 18px 0; border-bottom: 1px solid rgba(255,255,255,.2); }
.result-details div:nth-child(even) { padding-left: 20px; border-left: 1px solid rgba(255,255,255,.2); }
.result-details dt { color: #c5c7b9; font-size: 11px; }
.result-details dd { margin: 7px 0 0; font-size: 15px; }

.result-timeline { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; height: 35px; align-items: end; margin-top: 24px; }
.result-timeline i { min-height: 5px; background: rgba(255,255,255,.2); transition: height 220ms ease, background 220ms ease; }
.result-timeline i.is-active { background: var(--white); }
.result-note { position: relative; z-index: 1; margin: 16px 0 0; color: #c5c7b9; font-size: 11px; line-height: 1.45; }
.result-contacts { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.result-contacts label { display: block; border-bottom: 1px solid rgba(255,255,255,.32); }
.result-contacts label span { display: block; color: #c5c7b9; font-size: 10px; }
.result-contacts input { width: 100%; padding: 9px 0 14px; border: 0; outline: 0; background: transparent; color: var(--white); font-size: 15px; }
.result-contacts input::placeholder { color: #646466; }
.result-contacts label:focus-within { border-color: var(--white); }
.result-submit { position: relative; z-index: 1; display: flex; width: 100%; min-height: 64px; align-items: center; justify-content: space-between; gap: 20px; margin-top: 26px; padding: 0 5px 0 27px; border-radius: 999px; color: var(--ink); background: var(--white); font-size: 15px; font-weight: 500; }
.result-submit i { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 50%; color: var(--white); background: var(--ink); }
.result-submit svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.result-submit:disabled { cursor: wait; opacity: .65; }
.form-status { min-height: 16px; margin: 10px 0 0; color: #c5c7b9; font-size: 11px; text-align: center; }

.calculator-success { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(18,18,20,.72); backdrop-filter: blur(12px); }
.calculator-success__panel { position: relative; width: min(720px, 100%); padding: clamp(34px, 5vw, 72px); background: var(--white); }
.calculator-success__panel > button { position: absolute; top: 20px; right: 20px; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 25px; font-weight: 300; }
.calculator-success__panel > span { color: var(--gray); font-size: 13px; }
.calculator-success__panel h2 { margin: 28px 0 0; font-size: clamp(42px, 4vw, 68px); font-weight: 400; line-height: .96; letter-spacing: -.055em; }
.calculator-success__panel p { max-width: 520px; margin: 26px 0 0; color: var(--gray); font-size: 16px; line-height: 1.5; }
.calculator-success__panel a { display: flex; width: max-content; min-width: 265px; min-height: 64px; align-items: center; justify-content: space-between; gap: 20px; margin-top: 38px; padding: 0 7px 0 26px; border-radius: 999px; color: var(--white); background: var(--ink); font-size: 14px; }
.calculator-success__panel a i { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 50%; color: var(--ink); background: var(--white); font-size: 20px; font-style: normal; }
.calculator-success__panel a i svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-linecap:round; stroke-linejoin:round; stroke-width:1.6; }

@media (max-width: 980px) {
  .calculator-intro { grid-template-columns: 1fr; gap: 30px; }
  .calculator-copy { max-width: 760px; }
  .calculator-workspace { grid-template-columns: 1fr; }
  .calculator-controls { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
  .calculator-group--units, .cash-option { grid-column: 1 / -1; }
  .calculator-result { position: relative; top: auto; }
}

@media (max-width: 620px) {
  .calculator-header { padding-top: 22px; }
  .calculator-page { padding-top: 58px; padding-bottom: 72px; }
  .calculator-index p { display: none; }
  .calculator-copy h1 { font-size: clamp(48px, 15vw, 68px); }
  .calculator-copy > p { margin-top: 24px; font-size: 16px; }
  .calculator-workspace { margin-top: 56px; gap: 20px; }
  .calculator-controls { display: block; }
  .unit-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .unit-option > span { min-height: 108px; padding: 14px 11px; }
  .unit-option strong { font-size: 23px; }
  .month-options label { padding-inline: 4px; }
  .calculator-result { margin-inline: calc(var(--page-x) * -1); padding: 30px var(--page-x) 34px; }
  .calculator-result::after { top: -190px; right: -190px; }
  .result-primary strong { font-size: clamp(52px, 17vw, 72px); }
  .result-primary--cash strong { font-size: 44px; }
  .result-details { grid-template-columns: 1fr; }
  .result-details div:nth-child(even) { padding-left: 0; border-left: 0; }
  .result-contacts { grid-template-columns: 1fr; gap: 12px; }
  .result-submit { margin-top: 24px; }
  .calculator-success { padding: 0; place-items: end stretch; }
  .calculator-success__panel { padding: 38px 24px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition-duration: 0s !important; }
}
