:root {
  color-scheme: dark;
  --bg: #061126;
  --panel: rgba(14, 35, 72, 0.76);
  --panel-strong: #0d2145;
  --panel-soft: rgba(255, 255, 255, 0.04);
  --line: rgba(164, 200, 255, 0.16);
  --text: #f4f8ff;
  --muted: #b7c7e6;
  --cyan: #4fd3ff;
  --blue: #4f8dff;
  --violet: #8273ff;
  --green: #62e6bc;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 86% 8%, rgba(79, 141, 255, 0.17), transparent 32rem),
    radial-gradient(circle at 10% 42%, rgba(130, 115, 255, 0.1), transparent 28rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(85px);
  pointer-events: none;
}

.ambient-one {
  top: 13rem;
  left: -10rem;
  width: 22rem;
  height: 22rem;
  background: rgba(36, 200, 255, 0.07);
}

.ambient-two {
  right: -11rem;
  bottom: 2rem;
  width: 26rem;
  height: 26rem;
  background: rgba(55, 124, 255, 0.08);
}

.calculator-main {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.calculator-legacy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.calculator-legacy-brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.brand-name {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  justify-content: center;
  width: 27px;
  height: 27px;
  padding: 5px;
  border: 1px solid rgba(36, 200, 255, 0.35);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(36, 200, 255, 0.2), rgba(55, 124, 255, 0.12));
}

.brand-mark i {
  width: 3px;
  border-radius: 4px;
  background: linear-gradient(to top, var(--blue), var(--cyan));
}

.brand-mark i:nth-child(1) { height: 6px; }
.brand-mark i:nth-child(2) { height: 11px; }
.brand-mark i:nth-child(3) { height: 16px; }

.private-badge {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 8px 11px;
  color: #b8c8da;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  font-weight: 650;
}

.private-badge svg {
  width: 13px;
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.calculator-main {
  padding: 68px 0 72px;
}

.intro {
  max-width: 720px;
  margin-bottom: 42px;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 680px;
  margin-bottom: 15px;
  font-size: clamp(38px, 6.4vw, 66px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.intro p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(16px, 2.4vw, 19px);
  line-height: 1.55;
}

.calculator {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(360px, 0.84fr);
  gap: 18px;
  align-items: start;
}

.services-card,
.estimate-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow);
}

.services-card {
  padding: 28px;
}

.estimate-card {
  position: sticky;
  top: 90px;
  padding: 28px;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.card-heading > div {
  display: flex;
  gap: 11px;
  align-items: center;
}

.step-label {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--cyan);
  border: 1px solid rgba(36, 200, 255, 0.28);
  border-radius: 9px;
  background: rgba(36, 200, 255, 0.08);
  font-size: 10px;
  font-weight: 750;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.reset-button {
  padding: 5px 0;
  color: var(--muted);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
}

.reset-button:hover {
  color: var(--text);
}

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

.service-row,
.toggle-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 14px 15px;
  border: 1px solid rgba(164, 200, 255, 0.08);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
  transition: border-color 160ms ease, background 160ms ease;
}

.service-row:focus-within,
.toggle-row:has(input:focus-visible) {
  border-color: rgba(79, 211, 255, 0.42);
  background: rgba(79, 211, 255, 0.055);
}

.radio-plan-row {
  border-color: rgba(79, 211, 255, 0.24);
  background: linear-gradient(135deg, rgba(79, 211, 255, 0.09), rgba(130, 115, 255, 0.06));
}

.radio-plan-row .service-icon {
  box-shadow: 0 10px 30px rgba(79, 141, 255, 0.13);
}

.service-copy {
  display: flex;
  gap: 12px;
  min-width: 0;
  align-items: center;
}

.service-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  color: var(--cyan);
  border: 1px solid rgba(79, 211, 255, 0.25);
  border-radius: 15px;
  background: rgba(79, 211, 255, 0.08);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.service-icon svg {
  width: 21px;
  fill: none;
  stroke: #7bdcff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.service-copy label,
.service-copy strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 680;
  line-height: 1.3;
}

.service-copy small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.stepper {
  display: grid;
  grid-template-columns: 34px 42px 34px;
  height: 36px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(4, 11, 20, 0.6);
}

.stepper button {
  padding: 0;
  color: #afc0d4;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.stepper button:hover {
  color: var(--cyan);
  background: rgba(36, 200, 255, 0.07);
}

.stepper button:active {
  transform: scale(0.92);
}

.stepper input {
  width: 42px;
  padding: 0;
  color: var(--text);
  border: 0;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  outline: 0;
  background: rgba(255, 255, 255, 0.025);
  font-size: 14px;
  font-weight: 720;
  text-align: center;
  -moz-appearance: textfield;
}

.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.area-input {
  display: grid;
  grid-template-columns: 70px auto;
  align-items: center;
  height: 38px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(4, 11, 20, 0.6);
}

.area-input:focus-within {
  border-color: rgba(36, 200, 255, 0.56);
}

.area-input input {
  width: 70px;
  height: 100%;
  padding: 0 8px;
  color: var(--text);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 720;
  text-align: right;
  -moz-appearance: textfield;
}

.area-input input::-webkit-inner-spin-button,
.area-input input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.area-input span {
  padding-right: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.rate-details {
  margin: -2px 4px 4px;
  padding: 10px 12px;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(6, 15, 26, 0.34);
  font-size: 12px;
}

.rate-details summary {
  color: #a9bad0;
  cursor: pointer;
  font-weight: 680;
}

.rate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
  margin-top: 10px;
  line-height: 1.35;
}

.rate-grid span:last-child {
  grid-column: 1 / -1;
}

.select-wrap {
  position: relative;
  display: block;
  flex: 0 0 auto;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #9eb1c7;
  border-bottom: 1.5px solid #9eb1c7;
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.select-wrap select {
  min-width: 178px;
  height: 38px;
  padding: 0 35px 0 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: #0c1828;
  cursor: pointer;
  font-size: 12px;
  font-weight: 680;
  appearance: none;
}

.select-wrap select:focus-visible {
  border-color: rgba(36, 200, 255, 0.56);
}

.connector-controls {
  display: flex;
  gap: 9px;
  align-items: center;
  flex: 0 0 auto;
}

.connector-category-wrap select {
  min-width: 148px;
}

.toggle-row {
  position: relative;
  cursor: pointer;
}

.toggle-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex: 0 0 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: #24344a;
  transition: background 180ms ease, border-color 180ms ease;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d9e2ec;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  content: "";
  transition: transform 180ms ease, background 180ms ease;
}

.toggle-row input:checked + .switch {
  border-color: rgba(36, 200, 255, 0.75);
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.toggle-row input:checked + .switch::after {
  transform: translateX(18px);
  background: #fff;
}

.breakdown {
  display: grid;
  min-height: 186px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.breakdown-row:first-child {
  padding-top: 0;
}

.breakdown-row span {
  color: #b7c4d3;
  font-size: 13px;
  line-height: 1.35;
}

.breakdown-row strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  display: grid;
  min-height: 186px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.total-block {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid rgba(36, 200, 255, 0.18);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(36, 200, 255, 0.105), rgba(55, 124, 255, 0.08));
}

.total-block > span {
  display: block;
  margin-bottom: 7px;
  color: #a7b8ca;
  font-size: 12px;
}

.total-block strong {
  display: block;
  margin-bottom: 9px;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.total-block small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.copy-button {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 51px;
  margin-top: 12px;
  padding: 0 18px;
  color: #fff;
  border: 1px solid rgba(79, 211, 255, 0.55);
  border-radius: 14px;
  background: linear-gradient(135deg, #278fd1, #6457db);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  font-size: 14px;
  font-weight: 760;
  transition: transform 160ms ease, filter 160ms ease;
}

.copy-button:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.copy-button:active {
  transform: translateY(1px);
}

.feedback-button {
  color: var(--text);
  border: 1px solid rgba(119, 191, 255, 0.28);
  background: rgba(79, 141, 255, 0.09);
  box-shadow: none;
}

.feedback-button:hover {
  border-color: rgba(79, 211, 255, 0.55);
  background: rgba(79, 141, 255, 0.16);
}

.estimate-note {
  margin: 15px 2px 0;
  color: #7f92a8;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.calculator-footer-legacy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  color: #708299;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12px;
}

.calculator-footer-legacy a {
  color: #8fa2b8;
  text-decoration: none;
}

.calculator-footer-legacy a:hover {
  color: var(--cyan);
}

.toast {
  position: fixed;
  z-index: 10;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  padding: 11px 16px;
  color: #08151e;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
  font-size: 13px;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 820px) {
  .calculator {
    grid-template-columns: 1fr;
  }

  .estimate-card {
    position: static;
  }
}

@media (max-width: 560px) {
  .calculator-main {
    width: min(100% - 28px, 1180px);
  }

  .brand-name {
    font-size: 17px;
  }

  .private-badge {
    padding: 7px 9px;
    font-size: 10px;
  }

  .calculator-main {
    padding-top: 46px;
  }

  .intro {
    margin-bottom: 28px;
  }

  h1 {
    max-width: 360px;
    margin-bottom: 13px;
    font-size: clamp(36px, 11vw, 48px);
  }

  .intro p {
    max-width: 350px;
    font-size: 15px;
  }

  .services-card,
  .estimate-card {
    padding: 18px;
    border-radius: 21px;
  }

  .card-heading {
    margin-bottom: 17px;
  }

  .service-row,
  .toggle-row {
    min-height: 72px;
    padding: 12px;
  }

  .service-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 11px;
  }

  .service-icon svg {
    width: 19px;
  }

  .service-copy {
    gap: 9px;
  }

  .service-copy label,
  .service-copy strong {
    font-size: 13px;
  }

  .service-copy small {
    max-width: 190px;
    font-size: 10px;
  }

  .stepper {
    grid-template-columns: 30px 36px 30px;
    height: 34px;
  }

  .stepper input {
    width: 36px;
  }

  .area-input {
    grid-template-columns: 62px auto;
  }

  .area-input input {
    width: 62px;
  }

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

  .rate-grid span:last-child {
    grid-column: auto;
  }

  .select-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .select-row .service-copy {
    width: 100%;
  }

  .select-wrap,
  .select-wrap select {
    width: 100%;
  }

  .connector-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .connector-row .service-copy,
  .connector-controls {
    width: 100%;
  }

  .connector-controls .select-wrap {
    min-width: 0;
    flex: 1 1 auto;
  }

  .connector-controls .select-wrap select {
    min-width: 0;
  }

  .switch {
    width: 42px;
    height: 25px;
    flex-basis: 42px;
  }

  .switch::after {
    width: 17px;
    height: 17px;
  }

  .toggle-row input:checked + .switch::after {
    transform: translateX(17px);
  }

  .calculator-footer-legacy {
    min-height: 70px;
  }
}

@media (max-width: 390px) {
  .service-row,
  .toggle-row {
    gap: 8px;
    padding-inline: 10px;
  }

  .service-icon {
    display: none;
  }

  .service-copy small {
    max-width: 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
