/* Badzinger Auto design system — colors/gradients taken from badzingerauto.com:
 * page bg #030915, panels linear-gradient(132deg,#20293d,#0c1321),
 * accent #47b1f8, button gradient (99deg,#09f,#0079ca), font Manrope,
 * near-sharp corners (.08rem ≈ 1-2px on their site; we use 4-8px for usability). */

:root {
  --bg: #030915;
  --panel-grad: linear-gradient(132deg, #20293d 18.62%, #0c1321 73.87%);
  --btn-grad: linear-gradient(99deg, #09f 21.14%, #0079ca 67.6%);
  --btn-grad-hover: linear-gradient(254deg, #09f 22.98%, #006eb7 61.43%);
  --accent: #47b1f8;
  --line: rgba(190, 208, 220, .14);
  --text: #ffffff;
  --muted: #9ca3af;
  --soft: #bed0dc;
  --field-bg: rgba(255, 255, 255, .05);
  --radius: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Manrope', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
  padding: 26px 18px 60px;
}

.page { max-width: 1280px; margin: 0 auto; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 22px; margin-bottom: 24px; flex-wrap: wrap; }
.brand img { height: 34px; display: block; }
.topbar h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.3px; margin-right: auto; }
.topbar-actions { display: flex; gap: 18px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: none; cursor: pointer;
  color: var(--accent); font: 600 .92rem 'Manrope', sans-serif;
  padding: 6px 2px; transition: color .15s;
}
.link-btn:hover { color: #fff; }

.warn-banner {
  background: rgba(185, 28, 28, .15); border: 1px solid rgba(185, 28, 28, .45);
  color: #fda4a4; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; font-size: .9rem;
}

/* М'якший, «жовтий» банер: розрахунок робочий, але дані можуть бути несвіжі. */
.warn-banner.soft {
  background: rgba(202, 138, 4, .14); border-color: rgba(202, 138, 4, .5); color: #fcd34d;
  display: flex; align-items: flex-start; gap: 10px;
}
.warn-banner.soft b { color: #fde68a; }

/* ---------- columns ---------- */
/* Дві колонки: ліворуч поля, які заповнює відвідувач, праворуч — підсумки.
   Права трохи ширша: там довгі підписи на кшталт «Проходження кордону…». */
.columns { display: grid; grid-template-columns: 1fr 1.12fr; gap: 16px; align-items: start; }
@media (max-width: 980px) { .columns { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel-grad);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}

.panel-title {
  font-size: .82rem; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--soft); margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

/* ---------- fields ---------- */
.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }

/* Перелічувати типи поіменно не можна: під такий селектор не підпадають ні
   input[type=search], ні інпути взагалі без атрибута type (їх створює JS
   адмінки) — вони лишались із білим системним фоном. Тому беремо всі, крім
   чекбоксів і радіо, у яких свої стилі. */
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; padding: 13px 14px;
  font: 700 .88rem 'Manrope', sans-serif; letter-spacing: .4px;
  color: var(--text); background: var(--field-bg);
  border: 1px solid var(--line); border-radius: var(--radius);
  outline: none; transition: border-color .15s, box-shadow .15s;
  text-transform: uppercase;
}
/* Тільки для пошуку: інакше системний вигляд поля лізе поверх наших стилів.
   Числових полів не чіпаємо — там appearance:none прибрав би стрілки. */
input[type=search] { -webkit-appearance: none; appearance: none; }
input[type=search]::-webkit-search-decoration,
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
input:disabled { opacity: .55; cursor: not-allowed; }
input::placeholder { color: var(--soft); opacity: .75; font-weight: 700; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(71, 177, 248, .15); outline: none; }
select {
  appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' fill='none' stroke='%2347b1f8' stroke-width='2.4'%3E%3Cpath d='M2 3.5l3.5 4 3.5-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
select option { background: #0c1321; color: #fff; text-transform: none; }

/* ---------- rows with badges ---------- */
.labeled-row { margin-bottom: 13px; }
.labeled-row > label { display: block; font-size: .78rem; font-weight: 600; color: var(--soft); margin-bottom: 6px; }
.row-line { display: flex; gap: 8px; align-items: center; }
.row-line select, .row-line .combo { flex: 1; min-width: 0; }

.badge {
  flex-shrink: 0; min-width: 64px; height: 34px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(71, 177, 248, .13); border: 1px solid rgba(71, 177, 248, .25);
  border-radius: var(--radius);
  font-weight: 800; font-size: .88rem; color: var(--accent);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.badge-light { background: rgba(255, 255, 255, .92); color: #0079ca; border-color: transparent; }

.static-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 2px; border-bottom: 1px solid var(--line);
  font-size: .88rem; font-weight: 600; color: var(--text);
}
.static-row:last-child { border-bottom: none; }

/* ---------- location combobox ---------- */
/* Кнопка з вибраним значенням + панель із власним пошуком (як в еталона).
   Текст обраної локації не редагується, тож вибір не може зникнути на півслові. */
.combo { position: relative; }
.combo-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 13px 14px; cursor: pointer; text-align: left;
  font: 700 .88rem 'Manrope', sans-serif; letter-spacing: .4px; text-transform: uppercase;
  color: var(--text); background: var(--field-bg);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.combo-btn::after {
  content: ""; flex: 0 0 11px; height: 11px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' fill='none' stroke='%2347b1f8' stroke-width='2.4'%3E%3Cpath d='M2 3.5l3.5 4 3.5-4'/%3E%3C/svg%3E") no-repeat center;
  transition: transform .18s;
}
.combo-btn[aria-expanded="true"]::after { transform: rotate(180deg); }
.combo-btn:hover, .combo-btn[aria-expanded="true"] { border-color: var(--accent); }
.combo-btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(71, 177, 248, .15); }
.combo-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-value.placeholder { color: var(--soft); opacity: .75; }

.combo-pop {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: -72px;
  background: #131c2e; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
}
.combo-pop[hidden] { display: none; }
.combo-search { padding: 8px; border-bottom: 1px solid var(--line); }
/* Селектор із #locationPop навмисно: глобальне правило для полів має вищу
   специфічність (два :not з атрибутами) і перебило б і фон, і регістр. */
#locationPop .combo-search input {
  text-transform: none; letter-spacing: normal; font-weight: 600;
  padding: 9px 12px 9px 34px;
  background: var(--field-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath d='M9.5 9.5L13 13'/%3E%3C/svg%3E") no-repeat 11px center;
}

.combo-list { max-height: 264px; overflow-y: auto; list-style: none; }
.combo-list li { padding: 10px 13px; cursor: pointer; font-size: .85rem; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.04); }
.combo-list li:hover, .combo-list li.active { background: rgba(71, 177, 248, .16); }
/* Уже обрана локація помітна одразу — при відкритті список до неї прокручується.
   Галочка праворуч, як в еталона. */
.combo-list li.selected { color: var(--accent); display: flex; align-items: center; gap: 6px; }
.combo-list li.selected::after { content: "✓"; margin-left: auto; font-weight: 800; }
.combo-list li .port { color: var(--muted); font-size: .76rem; font-weight: 500; }
.combo-list li.empty { color: var(--muted); cursor: default; }

/* ---------- total banner ---------- */
/* Photo background (img/banner_bg.png) under a subdued blue gradient overlay.
 * Replace img/banner_bg.png with any brand photo — the overlay keeps text readable. */
.total-banner {
  margin-top: 16px;
  display: flex; gap: 26px; align-items: center; justify-content: space-between;
  background:
    linear-gradient(99deg, rgba(3, 12, 28, .94) 0%, rgba(5, 60, 110, .88) 48%, rgba(0, 110, 183, .72) 100%),
    url('img/banner_bg.png') center 60% / cover no-repeat,
    var(--panel-grad);
  border: 1px solid rgba(71, 177, 248, .25);
  border-radius: 12px; padding: 26px 30px;
  flex-wrap: wrap;
}
.total-text { max-width: 720px; }
.total-text h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.total-text p { font-size: .85rem; color: rgba(255, 255, 255, .92); margin-bottom: 6px; }
.total-text p.small { font-size: .76rem; color: rgba(255, 255, 255, .75); }
.transfer-row {
  margin-top: 12px; display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, .14); border-radius: var(--radius);
  padding: 9px 14px; font-size: .88rem; font-weight: 700;
}
.total-value {
  background: linear-gradient(138deg, rgba(255, 255, 255, .96) 0%, rgba(214, 233, 250, .9) 100%);
  color: #0c1321;
  border-radius: 10px; padding: 18px 34px;
  font-size: 2.6rem; font-weight: 800; letter-spacing: -1px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
}

/* ---------- CTA ---------- */
.cta-row { margin-top: 18px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cta-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(99deg, #47b1f8 0%, #0079ca 45%, #055c99 100%);
  background-size: 150% 100%; background-position: 0 0;
  color: #fff; text-decoration: none;
  font-weight: 700; font-size: .95rem;
  padding: 13px 30px; border-radius: var(--radius);
  transition: background-position .3s, transform .1s, box-shadow .2s;
  box-shadow: 0 6px 22px rgba(0, 121, 202, .35);
}
.cta-btn:hover { background-position: 100% 0; box-shadow: 0 8px 28px rgba(0, 121, 202, .5); }
.cta-btn:active { transform: translateY(1px); }
.port-note { color: #fcd34d; font-size: .85rem; font-weight: 600; }


/* ---------- модальне вікно заявки ---------- */
/* Оформлення повторює вікно «Підібрати авто» на badzingerauto.com: широка
   картка, великий капс-заголовок, поля і кнопка в один ряд, авто праворуч
   із виходом за край. Машина — їхній же ассет (img/lead_car.webp, з альфою). */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(3, 9, 21, .82);
  backdrop-filter: blur(3px);
}
.modal.hidden { display: none; }

.modal-card {
  position: relative; width: 100%; max-width: 960px;
  background: linear-gradient(103deg, #101a2e 0%, #16203a 46%, #0d1728 100%);
  border: 1px solid rgba(71, 177, 248, .18); border-radius: 15px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .65);
  max-height: calc(100vh - 40px); overflow: hidden;
}
/* Розсіяне світло у лівому верхньому куті — як ellipse на їхньому сайті. */
.modal-card::before {
  content: ""; position: absolute; top: -180px; left: -140px;
  width: 460px; height: 380px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(0, 153, 255, .30), transparent 72%);
}

.modal-body { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.modal-main { position: relative; z-index: 2; padding: 40px 0 40px 42px; min-width: 0; }

.modal-art { align-self: end; pointer-events: none; }
.modal-art img { display: block; width: 340px; max-width: 100%; height: auto; }

.modal-card h2 {
  font-size: 1.6rem; font-weight: 800; line-height: 1.18;
  text-transform: uppercase; margin-bottom: 22px; max-width: 15em;
}
.modal-close {
  position: absolute; top: 14px; right: 16px; z-index: 3;
  background: none; border: none; color: rgba(255, 255, 255, .75);
  font-size: 1.7rem; line-height: 1; cursor: pointer; padding: 4px 8px;
  transition: color .15s;
}
.modal-close:hover { color: #fff; }

/* Поля і кнопка в один ряд — головна прикмета їхньої форми. */
#leadForm { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.lead-field { flex: 1 1 190px; min-width: 0; }
/* Селектор навмисно з #leadForm: глобальне правило для полів має вищу
   специфічність (два :not з атрибутами), і без цього ПІБ показувався б капсом. */
#leadForm .lead-field input {
  height: 48px; padding: 0 16px;
  background: rgba(255, 255, 255, .16); border: 1px solid transparent;
  border-radius: 8px; color: #fff;
  font: 600 .9rem 'Manrope', sans-serif; text-transform: none; letter-spacing: normal;
}
.lead-field input::placeholder { color: rgba(255, 255, 255, .6); font-weight: 500; text-transform: none; }
#leadForm .lead-field input:focus { background: rgba(255, 255, 255, .22); border-color: var(--accent); box-shadow: none; }
.lead-field.invalid input { border-color: #fda4a4; }

.lead-submit {
  flex: 0 0 auto; height: 48px; padding: 0 34px;
  background: var(--btn-grad); border: none; border-radius: 8px;
  color: #fff; font: 700 .92rem 'Manrope', sans-serif; cursor: pointer;
  transition: filter .18s, transform .1s;
}
.lead-submit:hover { filter: brightness(1.12); }
.lead-submit:active { transform: translateY(1px); }
.lead-submit:disabled { opacity: .6; cursor: wait; }

.lead-error { display: block; margin-top: 6px; font-size: .76rem; color: #fda4a4; }
.lead-error-form { margin-top: 10px; }

/* Підсумок розрахунку — щоб людина бачила, з чим саме лишає заявку.
   У них цього блоку немає: це наше доповнення, тому навмисно тихе. */
.lead-summary {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: .78rem; color: rgba(255, 255, 255, .65); line-height: 1.7; max-width: 34em;
}
.lead-summary b { color: #fff; font-weight: 700; }

.lead-done.hidden, #leadFormView.hidden { display: none; }
.lead-done-sub { font-size: .92rem; color: rgba(255, 255, 255, .8); margin: -10px 0 22px; }

@media (max-width: 860px) {
  .modal-body { grid-template-columns: 1fr; }
  .modal-main { padding: 34px 24px 28px; }
  .modal-card { max-height: calc(100vh - 40px); overflow-y: auto; }
  .modal-card h2 { font-size: 1.25rem; }
  .lead-field { flex: 1 1 100%; }
  .lead-submit { width: 100%; }
  /* Авто на вузькому екрані лише заважало б формі. */
  .modal-art { display: none; }
}
