@font-face {
  font-family: Mont;
  src: url("../fonts/Mont-Regular.ttf") format("truetype");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Mont;
  src: url("../fonts/Mont-Bold.ttf") format("truetype");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand-red: #e2261c;
  --brand-red-rgb: 226, 38, 28;
  --brand-blue: #a1d9e5;
  --brand-white: #ffffff;
  --brand-gray: #777777;
  --brand-black: #000000;
  --brand-font: Mont, Arial, Helvetica, sans-serif;
  --brand-skew: -10deg;
  --brand-unskew: 10deg;
  --surface: #ffffff;
  --muted: #f5f5f5;
  --border: #e5e5e5;
  --radius: 4px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
  --max: 720px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--brand-font);
  color: var(--brand-black);
  background: var(--brand-white);
  line-height: 1.45;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--brand-red);
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  height: 36px;
  width: auto;
}

.header-phone {
  font-weight: 700;
  text-decoration: none;
  color: var(--brand-black);
  white-space: nowrap;
}

.header-phone:hover {
  color: var(--brand-red);
}

/* Hero strip */
.hero {
  position: relative;
  padding: 1.75rem 1.25rem 1.25rem;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 0;
  bottom: 0;
  width: 14px;
  background: var(--brand-red);
  transform: skewX(var(--brand-skew));
}

.hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0;
  color: var(--brand-gray);
  max-width: 36rem;
}

/* Layout */
.wrap {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto 3rem;
}

/* Progress */
.progress {
  display: flex;
  gap: 0.5rem;
  margin: 1.25rem 0 1.5rem;
  list-style: none;
  padding: 0;
}

.progress li {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  color: var(--brand-gray);
  position: relative;
  padding-top: 0.65rem;
}

.progress li::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: var(--border);
  transform: skewX(var(--brand-skew));
}

.progress li.is-active,
.progress li.is-done {
  color: var(--brand-black);
  font-weight: 700;
}

.progress li.is-active::before,
.progress li.is-done::before {
  background: var(--brand-red);
}

/* Panel */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1.5rem;
}

.panel-title {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.hint {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--brand-gray);
}

.hint strong {
  color: var(--brand-black);
  font-weight: 700;
}

.field-hint {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--brand-gray);
}

.extended-params {
  margin: 1.25rem 0 0.5rem;
  padding: 1rem 0 0;
  border-top: 1px solid var(--border);
}

.extended-params[hidden] {
  display: none !important;
}

.extended-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
}

/* Form */
.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.req::after {
  content: " *";
  color: var(--brand-red);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.input,
.select-trigger {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--brand-white);
  color: var(--brand-black);
  outline: none;
  transition: border-color 0.15s ease;
}

.input:focus,
.select-trigger:focus,
.combo.is-open .select-trigger {
  border-color: var(--brand-red);
}

/* Dashed hint on empty extended fields and mileage (while extended is open) */
.field.is-empty .input,
.field.is-empty .select-trigger {
  border-color: rgba(var(--brand-red-rgb), 0.55);
  border-style: dashed;
  border-width: 1.5px;
}

.input:disabled,
.select-trigger:disabled {
  background: var(--muted);
  color: var(--brand-gray);
  cursor: not-allowed;
}

.input::placeholder {
  color: #aaa;
}

/* Combobox */
.combo {
  position: relative;
}

.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  text-align: left;
}

.select-trigger .value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-trigger .chev {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--brand-gray);
}

.combo-panel {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--brand-white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  max-height: 260px;
}

.combo.is-open .combo-panel {
  display: flex;
}

.combo-search {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0.65rem 0.85rem;
}

.combo-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  overflow: auto;
  flex: 1;
}

.combo-list li {
  padding: 0.55rem 0.85rem;
  cursor: pointer;
}

.combo-list li:hover,
.combo-list li.is-active {
  background: rgba(var(--brand-red-rgb), 0.08);
}

.combo-list li.is-selected {
  font-weight: 700;
  color: var(--brand-red);
}

.combo-empty {
  padding: 0.75rem 0.85rem;
  color: var(--brand-gray);
  font-size: 0.9rem;
}

/* Goals */
.goals {
  display: grid;
  gap: 0.75rem;
}

.goal {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--brand-white);
  padding: 1rem 1rem 1rem 1.25rem;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.goal::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 4px;
  background: transparent;
  transform: skewX(var(--brand-skew));
  transform-origin: center center;
}

.goal:hover {
  border-color: #ccc;
}

.goal.is-selected {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 1px var(--brand-red);
}

.goal.is-selected::before {
  background: var(--brand-red);
}

.goal-title {
  display: block;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.goal-desc {
  display: block;
  font-size: 0.88rem;
  color: var(--brand-gray);
}

/* Actions — только кнопки со скосом */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 0.8rem 1.25rem;
  font-weight: 700;
  border-radius: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: skewX(var(--brand-skew));
  transition: opacity 0.15s, background 0.15s, filter 0.15s, border-color 0.15s;
}

.btn > span {
  display: inline-block;
  transform: skewX(var(--brand-unskew));
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand-red);
  color: var(--brand-white);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(0.95);
}

.btn-ghost {
  background: var(--brand-white);
  color: var(--brand-black);
  border: 1px solid var(--border);
  /* явно тот же наклон, что у primary */
  transform: skewX(var(--brand-skew));
}

.btn-ghost > span {
  transform: skewX(var(--brand-unskew));
}

a.btn {
  color: inherit;
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--brand-red);
  color: var(--brand-red);
}

.btn-block {
  width: 100%;
}

/* Result */
.result-car {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.price-block {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.price-card {
  padding: 1rem;
  border: 1px solid var(--border);
  background: var(--muted);
}

.price-card.is-accent {
  background: rgba(var(--brand-red-rgb), 0.06);
  border-color: rgba(var(--brand-red-rgb), 0.35);
}

.price-label {
  font-size: 0.8rem;
  color: var(--brand-gray);
  margin-bottom: 0.25rem;
}

.price-value {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 700;
}

.meta {
  font-size: 0.9rem;
  color: var(--brand-gray);
  margin: 0 0 1rem;
}

.disclaimer {
  font-size: 0.8rem;
  color: var(--brand-gray);
  margin: 1rem 0 0;
}

.error-box {
  margin: 0.75rem 0;
  padding: 0.75rem 0.9rem;
  background: rgba(226, 38, 28, 0.05);
  border: 1px solid rgba(226, 38, 28, 0.30);
  color: #000000;
  font-size: 0.9rem;
}

.error-box-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.error-box-text {
  margin: 0;
  flex: 1;
}

.error-box-action {
  margin-top: 0.65rem;
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
}

.error-box-action[hidden] {
  display: none !important;
}

.help-tip {
  position: relative;
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: help;
  line-height: 1;
  color: #000000;
  background: #fff;
}

.help-tip[hidden] {
  display: none !important;
}

.help-tip-bubble {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: min(280px, 70vw);
  padding: 0.75rem 0.85rem;
  background: var(--brand-black);
  color: var(--brand-white);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 30;
  pointer-events: none;
}

.help-tip-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0.45rem;
  border: 6px solid transparent;
  border-top-color: var(--brand-black);
}

.help-tip:hover .help-tip-bubble,
.help-tip:focus .help-tip-bubble,
.help-tip:focus-within .help-tip-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand-gray);
  font-size: 0.9rem;
}

.loading-inline[hidden],
.error-box[hidden],
.modal-backdrop[hidden],
.panel[hidden],
#result-meta[hidden],
#lead-thanks[hidden] {
  display: none !important;
}

.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border);
  border-top-color: var(--brand-red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
  }
}

.modal {
  width: min(100%, 420px);
  background: var(--brand-white);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.modal h3 {
  margin: 0 0 0.75rem;
}

.modal-note {
  font-size: 0.85rem;
  color: var(--brand-gray);
  margin: 0.5rem 0 0;
}

.site-footer {
  padding: 1.5rem 1.25rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--brand-gray);
  font-size: 0.8rem;
  text-align: center;
}

/* Admin floating panel */
.admin-panel {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  max-width: min(440px, calc(100vw - 2rem));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.admin-panel[hidden] {
  display: none !important;
}

.admin-toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--brand-black);
  color: var(--brand-white);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.admin-drawer {
  width: min(440px, calc(100vw - 2rem));
  background: #1a1a1a;
  color: #f0f0f0;
  border: 1px solid #333;
  box-shadow: var(--shadow);
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-drawer[hidden] {
  display: none !important;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #333;
  font-size: 0.85rem;
}

.admin-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #aaa;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
}

.admin-close:hover {
  color: #fff;
}

.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #333;
  overflow-x: auto;
}

.admin-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: #999;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.admin-tab:hover {
  color: #fff;
}

.admin-tab.is-active {
  color: #fff;
  border-bottom-color: var(--brand-red, #e2261c);
}

.admin-body {
  overflow: auto;
  padding: 0.75rem;
  flex: 1;
}

.admin-section[hidden] {
  display: none !important;
}

.admin-hint {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #aaa;
}

.admin-hint code {
  font-size: 0.72rem;
  color: #a1d9e5;
  background: #111;
  padding: 0.05rem 0.25rem;
}

.admin-field {
  margin-bottom: 0.75rem;
}

.admin-field label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ccc;
}

.admin-input {
  width: 100%;
  background: #111;
  color: #f0f0f0;
  border-color: #444;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8rem;
}

.admin-preview {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  color: #a1d9e5;
  line-height: 1.35;
}

.admin-error {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: #e9642c;
}

.admin-error[hidden] {
  display: none !important;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.admin-actions .btn {
  font-size: 0.75rem;
  padding: 0.45rem 0.7rem;
}

.admin-fields-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-field-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  padding: 0.35rem 0.45rem;
  background: #111;
  border: 1px solid #333;
}

.admin-field-row.is-locked {
  opacity: 0.65;
}

.admin-field-row input {
  margin: 0;
}

.admin-field-group {
  margin: 0.65rem 0 0.25rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
}

.admin-debug-label {
  margin: 0.5rem 0 0.2rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #999;
}

.admin-pre {
  margin: 0 0 0.5rem;
  padding: 0.55rem 0.65rem;
  background: #111;
  border: 1px solid #333;
  font-size: 0.72rem;
  line-height: 1.35;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 12rem;
  color: #a1d9e5;
}

[data-field][hidden] {
  display: none !important;
}
