.calc { background: var(--bg); color: #fff; padding: 80px 0 88px; }
.calc .sec-title { color: #fff; }
.calc .sec-sub { color: var(--text-secondary); }

.calc-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 26px;
  align-items: start;
}

.calc-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 28px 30px;
}

.cf { margin-bottom: 22px; }
.cf:last-child { margin-bottom: 0; }

.cf-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px;
}
.cf-label .val {
  font-size: 15px; font-weight: 800; color: #fff;
  text-transform: none; letter-spacing: 0;
}

.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.calc input[type=text],
.calc input[type=tel],
.calc select {
  width: 100%;
  border: 1.5px solid var(--border);
  background: var(--bg-input);
  border-radius: 11px;
  padding: 13px 14px;
  font-size: 15px;
  font-family: inherit;
  color: #fff;
  transition: 0.15s;
}
.calc input[type=text]::placeholder,
.calc input[type=tel]::placeholder { color: var(--text-dim); }
.calc input[type=text]:focus,
.calc input[type=tel]:focus,
.calc select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}
.calc select {
  padding-right: 36px;
  cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b9097' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.calc select option { background: var(--bg-card); color: #fff; }

.calc input[type=range] {
  width: 100%;
  accent-color: var(--red);
  height: 6px;
  cursor: pointer;
}
.range-ends {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-dim); margin-top: 6px;
}

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg-btn {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 6px;
  cursor: pointer;
  text-align: center;
  transition: 0.15s;
  font-family: inherit;
}
.seg-btn b { display: block; font-size: 14px; font-weight: 700; color: #e7e9ec; }
.seg-btn span { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.seg-btn.active {
  border-color: var(--red);
  background: var(--red-soft);
}
.seg-btn.active b { color: #fff; }

.calc .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.calc .opt {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: 11px; padding: 11px 12px; cursor: pointer;
  transition: 0.15s; font-size: 13px; color: #cfd2d6; user-select: none;
}
.calc .opt:hover { border-color: var(--border-hover); }
.calc .opt input { display: none; }
.calc .opt .box {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid #3a3f49; flex: none;
  display: grid; place-items: center; transition: 0.15s;
}
.calc .opt .box svg { width: 11px; height: 11px; stroke: #fff; stroke-width: 3; fill: none; opacity: 0; }
.calc .opt b { color: var(--red); font-weight: 700; margin-left: auto; white-space: nowrap; font-size: 12.5px; }
.calc .opt.on { border-color: var(--red); background: var(--red-soft); }
.calc .opt.on .box { background: var(--red); border-color: var(--red); }
.calc .opt.on .box svg { opacity: 1; }

.acc-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: 11px; cursor: pointer; font-family: inherit;
  padding: 12px 14px; color: inherit; text-align: left; transition: 0.15s;
}
.acc-toggle:hover { border-color: var(--border-hover); }
.acc-toggle[aria-expanded="true"] {
  border-color: var(--red);
  background: var(--red-soft);
}
.acc-toggle .at-l {
  font-size: 13.5px; font-weight: 700; color: #e7e9ec;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.acc-hint {
  font-size: 11.5px; font-weight: 600; color: var(--text-dim);
}
.acc-hint.on { color: #ff6b7a; }
.at-ic { width: 22px; height: 22px; display: grid; place-items: center; transition: 0.2s; flex: none; }
.at-ic svg { width: 13px; height: 13px; stroke: var(--text-muted); stroke-width: 2.6; fill: none; transition: 0.25s; }
.acc-toggle:hover .at-ic svg { stroke: #cfd2d6; }
.acc-toggle[aria-expanded="true"] .at-ic svg { stroke: var(--red); transform: rotate(180deg); }
.acc-body { overflow: hidden; max-height: 0; transition: max-height 0.32s ease; }
.acc-body.open { max-height: 680px; }
.calc .opts.acc-body.open { margin-top: 12px; }
#rDetails.acc-body.open { margin-top: 12px; }

.result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  display: flex; flex-direction: column;
  position: sticky; top: 88px;
}
.r-top { display: flex; justify-content: space-between; align-items: center; }
.result .r-kicker {
  font-size: 12px; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--text-muted);
}
.live {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #ff8a95; font-weight: 600;
  background: var(--red-soft); border: 1px solid rgba(230,0,18,0.3);
  padding: 3px 9px; border-radius: 30px;
}
.live .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--red);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(230,0,18,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(230,0,18,0); }
  100% { box-shadow: 0 0 0 0 rgba(230,0,18,0); }
}
.result .r-car {
  font-size: 16px; font-weight: 700; margin: 10px 0 14px; color: #fff;
}

.acc { margin-bottom: 14px; }
.acc-row {
  display: flex; justify-content: space-between;
  font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px;
}
.acc-row b { color: #fff; font-weight: 800; }
.acc-bar { height: 5px; border-radius: 5px; background: #22262d; overflow: hidden; }
.acc-fill {
  height: 100%; width: 70%;
  background: linear-gradient(90deg, var(--red), #ff4d5e);
  border-radius: 5px; transition: width 0.5s ease;
}

.price-box {
  background: linear-gradient(140deg, var(--red), #b3000e);
  border-radius: 14px; padding: 18px 20px; color: #fff;
  box-shadow: 0 12px 30px var(--red-glow);
}
.price-box .pb-label { font-size: 13px; opacity: 0.9; font-weight: 500; }
.price-box .pb-val {
  font-size: 28px; font-weight: 900; letter-spacing: -1px;
  margin-top: 3px; line-height: 1.05;
}
.pb-anchor { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pb-anchor .dealer { font-size: 13px; color: rgba(255,255,255,0.78); }
.pb-anchor .dealer s { font-weight: 700; }
.pb-benefit {
  font-size: 12.5px; font-weight: 800; background: #fff; color: #b3000e;
  padding: 4px 10px; border-radius: 7px; white-space: nowrap;
}
.price-box .pb-bonus {
  font-size: 12.5px; font-weight: 600; margin-top: 10px; opacity: 0.92;
  display: flex; align-items: center; gap: 5px;
}
.price-box .pb-hint {
  font-size: 12px; line-height: 1.45; margin-top: 8px; opacity: 0.86;
}
.pb-ways {
  list-style: none; margin: 12px 0 0; padding: 10px 0 0;
  border-top: 1px solid rgba(255,255,255,0.22);
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px; opacity: 0.92;
}
.pb-ways li b { font-weight: 800; margin-right: 5px; }

.price-box--note {
  background: linear-gradient(140deg, #2c333c, #1b2028);
}
.price-box--note .pb-note-val {
  font-size: 22px; font-weight: 900; letter-spacing: -0.5px;
  margin-top: 3px; line-height: 1.1;
}

.r-guar {
  list-style: none; margin: 16px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.r-guar li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #cfd2d6;
}
.r-guar li svg {
  width: 16px; height: 16px; flex: none;
  stroke: var(--red); stroke-width: 2.4; fill: none;
}

.r-gos, .r-phone { margin-top: 16px; }
.r-gos label, .r-phone label {
  display: block; font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; color: var(--text-muted);
  text-transform: uppercase; margin-bottom: 6px;
}
.r-gos input, .r-phone input {
  width: 100%; border: 1.5px solid var(--border);
  background: var(--bg-input); border-radius: 11px;
  padding: 12px 14px; font-size: 15px; font-family: inherit; color: #fff;
}
.r-gos input { text-transform: uppercase; }
.r-gos input:focus, .r-phone input:focus {
  outline: none; border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}
.r-phone.err input {
  border-color: #e24b4a;
  box-shadow: 0 0 0 3px rgba(226,75,74,0.18);
}
.r-phone .hint {
  font-size: 12px; color: #e07b7a; margin-top: 5px; display: none;
}
.r-phone.err .hint { display: block; }

.result .btn-red {
  width: 100%; padding: 15px; font-size: 15.5px;
  border-radius: 12px; margin-top: 14px;
  display: flex; flex-direction: column; gap: 2px; line-height: 1.15;
  background: var(--red); color: #fff; font-weight: 700;
  box-shadow: 0 6px 20px var(--red-glow); transition: 0.15s;
}
.result .btn-red:hover { background: var(--red-hover); }
.result .btn-red small { font-size: 11.5px; font-weight: 600; opacity: 0.85; }

.r-fixed {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; color: var(--text-muted); margin-top: 10px;
}
.r-fixed svg { width: 12px; height: 12px; fill: var(--text-muted); }
.r-fixed b { color: #fff; font-variant-numeric: tabular-nums; }

.r-msg {
  display: flex; gap: 8px; margin-top: 12px;
}
.r-msg a {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; padding: 11px; font-size: 13.5px; font-weight: 700;
  color: #fff; transition: 0.15s;
}
.r-msg a:hover { filter: brightness(1.08); }
.r-msg .wa { background: #25D366; }
.r-msg .tg { background: #229ED9; }
.r-msg .max { background: #2a2d36; border: 1px solid rgba(255,255,255,0.12); color: #fff; }

.r-risk {
  font-size: 11.5px; color: var(--text-muted);
  text-align: center; margin-top: 8px; line-height: 1.4;
}

.photo {
  border: 1.5px dashed #2f3742; border-radius: 12px;
  padding: 16px; text-align: center; cursor: pointer;
  transition: 0.15s; background: var(--bg-input);
}
.photo:hover { border-color: var(--red); background: var(--red-soft); }
.photo .ic {
  width: 32px; height: 32px; margin: 0 auto 6px;
  display: grid; place-items: center; color: var(--red);
}
.photo .ic svg { width: 28px; height: 28px; stroke: currentColor; stroke-width: 1.6; fill: none; }
.photo b { display: block; font-size: 13.5px; color: #e7e9ec; font-weight: 700; }
.photo span { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.photo.has { border-style: solid; border-color: var(--red); }
.photo-prev {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; justify-content: center;
}
.photo-prev img {
  width: 48px; height: 48px; object-fit: cover;
  border-radius: 7px; border: 1px solid var(--border);
}

.r-done { display: none; text-align: center; padding: 12px 4px; }
.r-done.show { display: block; animation: flash 0.45s ease; }
.r-done .dc {
  width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--red-soft); display: grid; place-items: center;
}
.r-done .dc svg { width: 30px; height: 30px; stroke: var(--red); stroke-width: 3; fill: none; }
.r-done h3 { font-size: 20px; font-weight: 900; color: #fff; }
.r-done p { font-size: 14px; color: var(--text-secondary); margin-top: 6px; line-height: 1.5; }
.r-done .cd {
  font-size: 36px; font-weight: 900; color: var(--red);
  font-variant-numeric: tabular-nums; margin: 16px 0 2px;
}
.r-done .cd-lbl {
  font-size: 12px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.r-done .locked {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 11px; padding: 12px; margin: 16px 0 4px;
}
.r-done .locked .l-lbl { font-size: 11.5px; color: var(--text-muted); }
.r-done .locked .l-val { font-size: 16px; font-weight: 800; color: #fff; margin-top: 2px; }

.flash { animation: flash 0.5s ease; }
@keyframes flash {
  0% { transform: scale(1); }
  40% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pf-label { font-size: 11.5px; color: var(--text-muted); margin-bottom: 5px; font-weight: 600; }

@media (max-width: 960px) {
  .calc-grid { grid-template-columns: 1fr; }
  .result { position: static; }
}

@media (max-width: 640px) {
  .calc { padding: 48px 0 56px; }
  .calc-panel { padding: 20px 16px; }
  .cf-row, .calc .opts, .pgrid { grid-template-columns: 1fr; }
  .seg { grid-template-columns: 1fr; }
  .result { padding: 18px 16px; }
  .price-box .pb-val { font-size: 24px; }
}

.calc-grid > .result.r-done {
  display: none;
}
.calc-grid > .result.r-done.show {
  display: flex;
}

.calc-grid.done > #rForm {
  display: none;
}
.calc-grid.done > #rDone {
  display: flex;
}

.calc-grid.done > #rForm { display: none !important; }
.calc-grid.done > #rDone {
  display: flex !important;
  grid-column: 2;
  grid-row: 1;
}
@media (max-width: 960px) {
  .calc-grid.done > #rDone {
    grid-column: 1;
    grid-row: 2;
  }
}

@media (max-width: 960px) {
  .result { position: relative; top: 0; }
  .calc-grid { gap: 20px; }
}
@media (max-width: 640px) {
  .calc { padding: 24px 0 40px; }
  .calc-panel, .result { padding: 16px; border-radius: 14px; }
  .seg { grid-template-columns: 1fr; }
  .seg-btn { min-height: 52px; text-align: left; padding: 12px 14px; }
  .pb-val { font-size: 28px; word-break: break-word; }
  .btn-red { width: 100%; min-height: 52px; }
  input[type="range"] { height: 28px; }
  .photo { min-height: 88px; }
}

.price-box, .r-car, .pb-val { overflow-wrap: anywhere; }

#cGos.err, .r-gos input.err {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 2px rgba(230, 0, 18, 0.2);
}
#cPhone:focus { outline: none; }
