/* RentCar – wspólne style (strona www + aplikacja). Jasny motyw z niebieskimi akcentami. */
:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #eef3fa;
  --border: #e1e8f1;
  --border-strong: #cdd8e6;
  --text: #0f1e33;
  --text-2: #3a4a61;
  --muted: #6a7a91;
  --primary: #1e6fd9;
  --primary-600: #1659b8;
  --primary-700: #114894;
  --primary-50: #ecf3fe;
  --primary-100: #d6e6fc;
  --primary-200: #b3d0f8;
  --navy: #0f2a4a;
  --success: #15924a;
  --success-50: #e7f6ed;
  --warning: #c26d06;
  --warning-50: #fdf3e2;
  --danger: #d23434;
  --danger-50: #fdeceb;
  --violet: #6352d9;
  --violet-50: #efedfd;
  --gray-50: #f1f4f8;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 42, 80, .06);
  --shadow: 0 2px 6px rgba(16, 42, 80, .06), 0 8px 24px rgba(16, 42, 80, .06);
  --shadow-lg: 0 12px 40px rgba(16, 42, 80, .16);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; color: var(--navy); letter-spacing: -.01em; }
h1 { font-size: 1.9rem; font-weight: 800; }
h2 { font-size: 1.4rem; font-weight: 750; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
small, .small { font-size: .85em; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
}

/* ---------- przyciski ---------- */
.btn {
  --b: var(--surface); --c: var(--text); --bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  font: inherit; font-weight: 600; font-size: 14px; line-height: 1.2;
  color: var(--c); background: var(--b); border: 1px solid var(--bd); border-radius: 10px;
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--primary-200); outline-offset: 1px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { --b: var(--primary); --c: #fff; --bd: var(--primary); box-shadow: 0 2px 8px rgba(30, 111, 217, .25); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-soft { --b: var(--primary-50); --c: var(--primary-700); --bd: transparent; }
.btn-soft:hover { background: var(--primary-100); }
.btn-ghost { --b: transparent; --bd: transparent; --c: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { --b: var(--surface); --c: var(--danger); --bd: #f2c4c4; }
.btn-danger:hover { background: var(--danger-50); }
.btn-success { --b: var(--success); --c: #fff; --bd: var(--success); }
.btn-success:hover { background: #107a3d; }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { min-height: 50px; padding: 12px 22px; font-size: 16px; border-radius: 12px; }
.btn-icon { padding: 0; width: 40px; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }

/* ---------- formularze ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field > small { color: var(--muted); font-size: 12px; }
.field.req > span::after { content: " *"; color: var(--danger); }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 9px 12px; min-height: 42px; width: 100%; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 34px; 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 1.5 6 6.5l5-5' fill='none' stroke='%236a7a91' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--primary); flex: none; }
input[disabled], select[disabled], textarea[disabled] { background: var(--surface-2); color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.check.top { align-items: flex-start; }
.check.top input { margin-top: 2px; }
.input-group { display: flex; }
.input-group > input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .addon { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 10px 10px 0; background: var(--surface-2); color: var(--muted); font-size: 14px; }

/* ---------- karty, plakietki ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 1rem; }
.card-body { padding: 18px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 650; line-height: 1.5; white-space: nowrap;
  background: var(--gray-50); color: var(--text-2); border: 1px solid transparent;
}
.pill svg { width: 14px; height: 14px; }
.pill.blue { background: var(--primary-50); color: var(--primary-700); }
.pill.green { background: var(--success-50); color: var(--success); }
.pill.orange { background: var(--warning-50); color: var(--warning); }
.pill.red { background: var(--danger-50); color: var(--danger); }
.pill.violet { background: var(--violet-50); color: var(--violet); }
.pill.outline { background: transparent; border-color: var(--border-strong); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(15, 30, 51, .5);
  animation: fade .15s ease-out;
}
.modal {
  width: 100%; max-width: 560px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); animation: pop .18s ease-out; overflow: hidden;
}
.modal.sm { max-width: 420px; }
.modal.lg { max-width: 820px; }
.modal.xl { max-width: 1080px; }
.modal.full { max-width: 1180px; height: calc(100dvh - 32px); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 1.15rem; flex: 1; min-width: 0; }
.modal-body { padding: 20px; overflow: auto; flex: 1 1 auto; -webkit-overflow-scrolling: touch; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }
@media (max-width: 640px) {
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal, .modal.full { max-width: none; max-height: 100dvh; height: auto; border-radius: 18px 18px 0 0; }
  .modal.full { height: 100dvh; border-radius: 0; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- powiadomienia ---------- */
.toasts { position: fixed; z-index: 200; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px;
  background: var(--navy); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; animation: pop .2s ease-out;
}
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.success { background: #0f6b39; }
.toast.error { background: #a32121; }
.toast.warn { background: #8a4b00; }
.toast button { margin-left: auto; color: #fff; background: rgba(255, 255, 255, .15); border: 0; border-radius: 8px; padding: 4px 10px; font: inherit; font-weight: 600; cursor: pointer; }

/* ---------- tabele ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--primary-50); }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--primary-200); }

.spinner { width: 18px; height: 18px; border: 2.5px solid var(--primary-100); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; }
.brand img { width: 38px; height: 38px; }
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--navy); }
.brand-name b { color: var(--primary); font-weight: 800; }
.brand img.brand-logo { width: auto; height: 40px; max-width: 220px; object-fit: contain; }
.brand img.brand-logo + .brand-name { white-space: nowrap; font-size: 20px; }

/* ---------- porównanie pakietów ochrony ---------- */
.ins { container: ins / inline-size; }
.ins-table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.ins-table thead .ins-corner { width: 30%; }
.ins-table th, .ins-table td { padding: 11px 10px; border-bottom: 1px solid var(--border); text-align: center; vertical-align: middle; }
.ins-table .ins-feat { text-align: left; font-weight: 500; color: var(--text); }
.ins-feat { display: table-cell; }
.ins-feat > span { vertical-align: middle; }
.ins-feat .ic { width: 26px; height: 26px; color: var(--primary); margin-right: 12px; vertical-align: middle; display: inline-block; }
.ins-corner span { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ins-table thead th { border-bottom: 2px solid var(--border); padding: 0; vertical-align: bottom; }
.ins-table thead .ins-corner { padding: 0 10px 12px; }
.ins-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; padding: 10px 6px 12px;
  background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; font: inherit; color: var(--text); cursor: pointer;
}
.ins-tab:hover .ins-name { color: var(--primary); }
.ins-name { font-size: 20px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.ins-price { font-size: 12px; color: var(--muted); font-weight: 600; }
.ins-badge { font-size: 10.5px; font-weight: 700; color: #fff; background: var(--primary); border-radius: 999px; padding: 1px 8px; text-transform: uppercase; letter-spacing: .04em; }
/* „Polecany”: zaokrąglona pastylka na lewej górnej krawędzi ramki kolumny pakietu (położenie w ramce – insurance.js →
   insuranceOutline), na telefonie – na górnej krawędzi karty pakietu */
.ins-table thead th.ins-col .ins-badge, .ins-mcard .ins-badge { position: absolute; z-index: 3; left: 16px; top: 0; transform: translateY(-50%);
  padding: 4px 12px; font-size: 11px; line-height: 1.2; white-space: nowrap; border: 2px solid #fff;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--primary) 35%, transparent); }
.ins-col.sel { background: var(--primary-50); }
/* wybór pakietu (rezerwacja): zamiast tła kolumny – niebieski ptaszek w prawym górnym rogu; po najechaniu delikatne podświetlenie */
.ins.pickable .ins-col.sel { background: none; }
.ins-table thead th.ins-col { position: relative; }
/* ptaszek wybranego pakietu – na prawym górnym narożniku ramki jego kolumny */
.ins-sel-check { position: absolute; z-index: 3; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; pointer-events: none;
  background: var(--primary); color: #fff; border: 2px solid #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 45%, transparent); }
.ins-sel-check .ic { width: 16px; height: 16px; stroke-width: 3.2; }
.ins.pickable .ins-col { cursor: pointer; transition: background .15s; }
.ins.pickable .ins-col.hov { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.ins-col.sel .ins-name { color: var(--primary-700); }
/* wyróżniony pakiet (Ustawienia → Pakiety ochrony → „Wyróżniony”) – kolor wyróżnienia --ins-hl (domyślnie zielony),
   pastelowe tło kolumny i ramka w tym kolorze */
.ins-col.top { background: color-mix(in srgb, var(--ins-hl, var(--success)) 9%, #fff); }
/* biały kontener tabeli (.ins-frame) i ramka najwyższego pakietu wychodząca ponad jego górną i dolną krawędź (insurance.js → insuranceOutline) */
.ins-frame { position: relative; }
.ins-outline { position: absolute; z-index: 0; pointer-events: none; border: 2px solid var(--ins-hl, var(--success)); border-radius: 18px;
  background: color-mix(in srgb, var(--ins-hl, var(--success)) 9%, #fff); box-shadow: 0 14px 34px color-mix(in srgb, var(--ins-hl, var(--success)) 22%, transparent); }
.ins-frame .ins { position: relative; z-index: 1; }
/* przypis pod porównaniem pakietów: kaucja dla wskazanych klas może być inna */
.ins-foot { position: relative; z-index: 1; margin-top: 38px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.ins-foot p { margin: 4px 0 0; }
.ins-star { font-size: .8em; line-height: 0; margin-left: 2px; font-weight: 700; color: inherit; }
.ins-frame.has-outline .ins-col.top { background: transparent; }
/* wybrany pakiet (nie najwyższy) – niebieska ramka na tej samej zasadzie co zielona */
.ins-outline.sel { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 14px 34px color-mix(in srgb, var(--primary) 20%, transparent); }
.ins-frame.has-sel .ins.pickable .ins-col.sel { background: transparent; }
/* w kontenerze z ramkami podświetla się cała ramka kolumny (insurance.js → bindInsurance), a nie same komórki */
.ins-frame .ins.pickable .ins-col.hov { background: transparent; }
.ins-outline.top.hov { background: color-mix(in srgb, var(--ins-hl, var(--success)) 15%, #fff); }
.ins-outline.sel.hov { background: color-mix(in srgb, var(--primary) 12%, #fff); }
.ins-outline.hover-box { border-color: var(--primary-100); background: color-mix(in srgb, var(--primary) 5%, #fff); box-shadow: 0 10px 26px rgba(16, 42, 80, .08); }
/* nazwy pakietów wyśrodkowane w pionie w komórkach nagłówka */
.ins-table thead th.ins-col { vertical-align: middle; }
.ins-table thead th.ins-col .ins-tab { justify-content: center; min-height: 92px; }

.ins-col.top .ins-name { color: color-mix(in srgb, var(--ins-hl, var(--success)) 78%, #000); }
/* pakiety ochrony: „w pakiecie” – wyraźny ptaszek w zielonym kółku; „brak” – drobny, wyblakły krzyżyk */
.ins-mark { display: inline-grid; place-items: center; border-radius: 50%; }
.ins-mark.yes { width: 30px; height: 30px; background: var(--success); color: #fff; box-shadow: 0 3px 8px color-mix(in srgb, var(--success) 35%, transparent); }
.ins-mark.yes .ic { width: 18px; height: 18px; stroke-width: 3.2; }
.ins-mark.no { width: 26px; height: 26px; background: #f1f4f8; color: #b4bfcd; }
.ins-mark.no .ic { width: 13px; height: 13px; stroke-width: 2.2; }
.ins-val { font-weight: 650; white-space: nowrap; }
/* udział własny i kaucja: pastylki wg poziomu pakietu – podstawowy czerwona, pośredni pomarańczowa, najwyższy zielona (większa) */
.ins-val[class*="lv-"] { display: inline-flex; align-items: center; justify-content: center; gap: 6px; max-width: 100%; padding: 4px 12px; border-radius: 14px;
  color: #fff; font-weight: 700; line-height: 1.35; text-align: center; white-space: normal; }
.ins-val.lv-low, .ins-val.lv-mid { font-size: .9em; font-weight: 650; padding: 3px 11px; }
.ins-val.lv-low { background: #fdecec; color: #b42318; box-shadow: inset 0 0 0 1px #f9caca; }
.ins-val.lv-mid { background: #fff1e0; color: #b45309; box-shadow: inset 0 0 0 1px #fbd9ae; }
.ins-val.lv-top { background: var(--success); font-size: 1.15em; padding: 6px 16px; }
.ins-val.lv-top.zero { font-size: 1.35em; font-weight: 800; letter-spacing: .02em; padding: 6px 18px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 22%, transparent), 0 6px 16px color-mix(in srgb, var(--success) 35%, transparent); }
.ins-val.zero .ic { width: 1em; height: 1em; stroke-width: 3; flex: none; }
.ins-sum th, .ins-sum td { border-bottom: 0; padding-top: 14px; }
.ins-sum td b { display: block; font-size: 17px; color: var(--navy); }
.ins-sum td s { display: block; font-size: 13px; color: var(--muted); }
.ins-online { font-size: 12.5px; color: var(--primary-700); font-weight: 650; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* wąski kontener (telefon): karty pakietów jedna pod drugą zamiast tabeli */
.ins-cards { display: none; }
@container ins (max-width: 560px) {
  .ins-table { display: none; }
  .ins-cards { display: flex; flex-direction: column; gap: 16px; padding: 6px 2px; }
}
.ins-mcard { position: relative; border: 1.5px solid var(--border); border-radius: 16px; padding: 14px 16px 12px; background: #fff; }
.ins-mcard.top { border: 2px solid var(--ins-hl, var(--success)); background: color-mix(in srgb, var(--ins-hl, var(--success)) 9%, #fff);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--ins-hl, var(--success)) 18%, transparent); }
.ins-mcard.sel:not(.top) { border: 2px solid var(--primary); background: var(--primary-50); box-shadow: 0 10px 26px color-mix(in srgb, var(--primary) 16%, transparent); }
.ins.pickable .ins-mcard { cursor: pointer; }
.ins-mcheck { position: absolute; top: -13px; right: -13px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: #fff; border: 2px solid #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 45%, transparent); }
.ins-mcheck .ic { width: 16px; height: 16px; stroke-width: 3.2; }
.ins-mhead { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 10px; }
.ins-mhead .ins-price { flex-basis: 100%; }
.ins-mcard.top .ins-name { color: color-mix(in srgb, var(--ins-hl, var(--success)) 78%, #000); }
.ins-mcard.sel:not(.top) .ins-name { color: var(--primary-700); }
.ins-mfeat { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ins-mfeat li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.ins-mfeat li.no { color: var(--muted); }
.ins-mfeat .ins-mark.yes { width: 24px; height: 24px; flex: none; }
.ins-mfeat .ins-mark.yes .ic { width: 14px; height: 14px; }
.ins-mfeat .ins-mark.no { width: 24px; height: 24px; flex: none; }
.ins-mfeat .ins-mark.no .ic { width: 11px; height: 11px; }
.ins-mvals { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.ins-mvals > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-2); }
.ins-mvals .ins-val { white-space: normal; text-align: right; }
.ins-msum b { font-size: 15px; color: var(--navy); }
