/* Окна «Получить расчёт стоимости», калькулятор и чек-лист на странице «Таксопаркам». */
.cost-dialog {
  position: fixed; inset: 0; margin: auto; width: min(94vw, 640px); max-height: calc(100dvh - 32px);
  overflow-y: auto; padding: 36px 32px 28px; color: #fff; font-family: inherit;
  background: rgb(62, 52, 56);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 24px; box-shadow: 0 30px 70px -24px #000;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.cost-dialog::backdrop { background: rgba(14, 10, 12, 0.72); backdrop-filter: blur(5px); }
.cost-dialog [hidden] { display: none; }
.cost-dialog h2 { margin: 0 48px 8px 0; font-size: 1.55rem; line-height: 1.25; letter-spacing: -0.01em; }
.cost-dialog p { line-height: 1.6; margin: 0 0 22px; color: rgba(255, 255, 255, 0.78); }
.cost-dialog button, .cost-dialog a { font-family: inherit; }
.cost-dialog :focus-visible { outline: 2px solid rgb(255, 204, 34); outline-offset: 3px; }

/* ---- Окно выбора: две карточки ---- */
.cost-options { display: grid; gap: 12px; margin-top: 22px; }
.cost-choice {
  display: flex; align-items: center; gap: 16px; width: 100%; padding: 18px 18px 18px 16px; text-align: left; color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 18px; background: rgb(52, 43, 47); cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
}
.cost-choice:hover { border-color: rgb(255, 204, 34); background: rgb(57, 47, 51); transform: translateY(-1px); }
.cc-ico {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
  background: rgba(255, 204, 34, 0.12); border: 1px solid rgba(255, 204, 34, 0.35); color: rgb(255, 204, 34);
}
.cc-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cc-text { flex: 1; display: grid; gap: 4px; min-width: 0; }
.cost-choice .cc-text strong { font-size: 1.08rem; line-height: 1.3; }
.cost-choice .cc-text span { font-size: 0.92rem; line-height: 1.45; color: rgba(255, 255, 255, 0.72); }
.cc-arrow { flex: none; width: 10px; height: 10px; margin-right: 6px; border-top: 2px solid rgba(255, 255, 255, 0.55); border-right: 2px solid rgba(255, 255, 255, 0.55); transform: rotate(45deg); transition: transform 0.2s, border-color 0.2s; }
.cost-choice:hover .cc-arrow { border-color: rgb(255, 204, 34); transform: translateX(3px) rotate(45deg); }

/* ---- Калькулятор ---- */
#costForm { counter-reset: costStep; }
.cost-dialog fieldset {
  min-width: 0; margin: 0 0 14px; padding: 18px 18px 6px; border: 0; border-radius: 18px;
  background: rgb(52, 43, 47); counter-increment: costStep;
}
.cost-dialog legend {
  float: left; width: 100%; display: flex; align-items: center; gap: 10px; padding: 0; margin: 0 0 16px;
  font-size: 1.02rem; font-weight: 700;
}
.cost-dialog legend::before {
  content: counter(costStep); display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: rgb(255, 204, 34); color: rgb(36, 29, 32); font-size: 0.85rem; font-weight: 800;
}
.cost-dialog legend + * { clear: both; }
.cost-field { display: block; margin: 0 0 16px; }
.cost-field > span { display: block; font-weight: 600; line-height: 1.4; margin-bottom: 8px; }
.cost-field small { display: block; color: rgba(255, 255, 255, 0.64); font-size: 0.82rem; line-height: 1.5; margin-top: 6px; }

/* числовые поля: вопрос слева, компактное поле справа, без стрелок */
.cost-num { display: grid; grid-template-columns: minmax(0, 1fr) 96px; column-gap: 16px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.cost-num > span { margin: 0; }
.cost-num small { grid-column: 1 / -1; }
fieldset > .cost-num:last-child, fieldset > .cost-field:last-child { border-bottom: 0; }
.cost-dialog input[type="number"] {
  width: 100%; padding: 11px 12px; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 12px;
  background: rgb(40, 33, 36); color: #fff; font: inherit; font-size: 1.1rem; font-weight: 700; text-align: center;
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
  transition: border-color 0.2s;
}
.cost-dialog input[type="number"]::-webkit-outer-spin-button,
.cost-dialog input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cost-dialog input[type="number"]:hover { border-color: rgba(255, 255, 255, 0.4); }
.cost-dialog input[type="number"]:focus { border-color: rgb(255, 204, 34); outline: none; }

/* переключатель ИП / ООО */
.cost-seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: rgb(40, 33, 36); border: 1px solid rgba(255, 255, 255, 0.12); }
.cost-seg label { position: relative; }
.cost-seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.cost-seg label > span { display: block; min-width: 92px; padding: 10px 22px; border-radius: 10px; text-align: center; font-weight: 700; color: rgba(255, 255, 255, 0.78); transition: background-color 0.2s, color 0.2s; }
.cost-seg input:checked + span { background: rgb(255, 204, 34); color: rgb(36, 29, 32); }
.cost-seg input:focus-visible + span { outline: 2px solid rgb(255, 204, 34); outline-offset: 2px; }

/* варианты-карточки: аренда и НДС */
.cost-opts { display: grid; gap: 8px; }
.cost-opt, .cost-check {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 13px 14px; margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 14px; background: rgb(40, 33, 36); cursor: pointer;
  line-height: 1.4; transition: border-color 0.2s, background-color 0.2s;
}
.cost-opt:hover, .cost-check:hover { border-color: rgba(255, 255, 255, 0.35); }
.cost-opt input, .cost-check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: rgb(255, 204, 34); cursor: pointer; }
.cost-opt:has(input:checked), .cost-check:has(input:checked) { border-color: rgb(255, 204, 34); background: rgba(255, 204, 34, 0.08); }
.co-t { flex: 1; font-weight: 600; }
.co-p { flex: none; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-size: 0.85rem; font-weight: 700; white-space: nowrap; color: rgba(255, 255, 255, 0.86); }
.cost-check { margin: 0 0 16px; }

/* кнопки */
.cost-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.cost-primary, .cost-secondary {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; border-radius: 12px; padding: 13px 22px;
  font-size: 0.98rem; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; transition: transform 0.15s, background-color 0.2s, border-color 0.2s;
}
.cost-primary { background: rgb(255, 204, 34); color: rgb(36, 29, 32); border: 1px solid transparent; }
.cost-primary:hover { background: rgb(255, 214, 70); transform: translateY(-1px); }
.cost-secondary { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.3); }
.cost-secondary:hover { border-color: rgb(255, 204, 34); }
#costForm .cost-actions { position: sticky; bottom: -28px; margin: 18px -32px -28px; padding: 16px 32px 24px; background: rgb(62, 52, 56); border-top: 1px solid rgba(255, 255, 255, 0.08); }
#costForm .cost-primary { flex: 1; }

/* результат */
#costTotal { display: block; font-size: clamp(1.9rem, 6vw, 2.6rem); font-weight: 800; color: rgb(255, 204, 34); margin: 12px 0 18px; font-variant-numeric: tabular-nums; }
#costBreakdown { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0; margin: 0 0 18px; padding: 6px 16px; border-radius: 16px; background: rgb(52, 43, 47); }
#costBreakdown dt, #costBreakdown dd { padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
#costBreakdown dt:nth-last-of-type(1), #costBreakdown dd:last-of-type { border-bottom: 0; }
#costBreakdown dt { font-size: 0.92rem; color: rgba(255, 255, 255, 0.8); }
#costBreakdown dd { margin: 0; padding-left: 14px; text-align: right; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
#costError { color: #ffb4b4; font-weight: 600; }
#costError:not(:empty) { margin-top: 4px; }

@media (max-width: 480px) {
  .cost-dialog { padding: 30px 18px 22px; }
  .cost-dialog h2 { font-size: 1.28rem; }
  .cost-dialog fieldset { padding: 16px 14px 4px; }
  .cost-num { grid-template-columns: minmax(0, 1fr) 82px; column-gap: 12px; }
  .cost-seg { display: grid; width: 100%; }
  .cost-seg label > span { min-width: 0; }
  .cost-opt, .cost-check { flex-wrap: wrap; }
  #costForm .cost-actions { bottom: -22px; margin: 18px -18px -22px; padding: 14px 18px 20px; }
  .cc-ico { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .cost-choice, .cc-arrow, .cost-primary, .cost-opt, .cost-check { transition: none; }
  .cost-choice:hover, .cost-primary:hover { transform: none; }
}
