:root {
  --bg: #0a0e1a;
  --bg-2: #12162a;
  --surface: #161b30;
  --surface-2: #1c2340;
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef1fb;
  --muted: #9aa4c2;
  --accent: #00d4ff;
  --accent-2: #4f7bff;
  --danger: #ff6b6b;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Atrybut hidden musi wygrywać z regułami display: flex/grid poniżej. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: min(1160px, 92%); margin: 0 auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 14px 26px; border-radius: 999px;
  font-weight: 600; font-size: 15px; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 10px 20px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041018; box-shadow: 0 8px 24px rgba(0, 212, 255, 0.25);
}
.btn-primary:hover { box-shadow: 0 12px 32px rgba(0, 212, 255, 0.4); transform: translateY(-2px); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(10, 14, 26, 0.75);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; }
.brand-logo { height: 46px; width: auto; display: block; transition: transform .15s ease; }
.brand:hover .brand-logo { transform: scale(1.04); }
.nav-links { display: flex; gap: 32px; }
.nav-links a { color: var(--muted); font-weight: 500; transition: color .15s; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 20px; }
.nav-phone {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text); font-weight: 700; font-size: 15px; white-space: nowrap;
  transition: color .15s;
}
.nav-phone svg { width: 17px; height: 17px; color: var(--accent); }
.nav-phone:hover { color: var(--accent); }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  padding: 112px 0 92px;
  background-color: var(--bg);
  background-image:
    linear-gradient(97deg, rgba(8, 11, 22, 0.95) 0%, rgba(8, 11, 22, 0.82) 36%, rgba(8, 11, 22, 0.44) 64%, rgba(11, 17, 36, 0.58) 100%),
    linear-gradient(to bottom, rgba(8, 11, 22, 0.70) 0%, rgba(8, 11, 22, 0) 24%, rgba(8, 11, 22, 0) 52%, var(--bg) 100%),
    url("/images/hero-fleet.jpg");
  background-size: cover;
  background-position: center, center, center 58%;
  background-repeat: no-repeat;
}
.hero-inner { max-width: 720px; position: relative; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 3px; font-size: 13px;
  color: var(--accent); font-weight: 700; margin: 0 0 16px;
}
.hero h1 {
  font-size: clamp(40px, 7vw, 72px); line-height: 1.02; margin: 0 0 20px;
  letter-spacing: -2px; font-weight: 800; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}
.hero h1 .accent { color: var(--accent); }
.lead { font-size: 19px; color: var(--muted); max-width: 560px; margin: 0 0 32px; }
.hero .lead { color: rgba(238, 241, 251, 0.90); text-shadow: 0 1px 16px rgba(0, 0, 0, 0.35); }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; margin-top: 56px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats div + div { padding-left: 36px; border-left: 1px solid rgba(255, 255, 255, 0.16); }
.hero-stats strong { font-size: 30px; font-weight: 800; }
.hero-stats span { color: var(--muted); font-size: 14px; }
.hero .hero-stats span { color: rgba(238, 241, 251, 0.74); }

/* Sections */
section { padding: 80px 0; }
.section-head { margin-bottom: 40px; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 8px; letter-spacing: -1px; }
.section-head p { color: var(--muted); margin: 0; font-size: 17px; }

/* Filters */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.filter-chip {
  padding: 8px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all .15s;
}
.filter-chip:hover { color: var(--text); }
.filter-chip.active { background: var(--accent); color: #041018; border-color: var(--accent); font-weight: 700; }

/* Car grid */
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.loading { color: var(--muted); padding: 40px 0; }
.car-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.car-card:hover { transform: translateY(-4px); border-color: rgba(0, 212, 255, 0.4); box-shadow: var(--shadow); }
.car-img { position: relative; aspect-ratio: 16/9; background: var(--bg-2); }
.car-img img { width: 100%; height: 100%; object-fit: cover; }
.car-badge {
  position: absolute; top: 14px; left: 14px; padding: 5px 12px; border-radius: 999px;
  background: rgba(10, 14, 26, 0.72); backdrop-filter: blur(6px);
  font-size: 12px; font-weight: 600; color: var(--accent); border: 1px solid var(--border);
}
.car-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.car-name { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -0.3px; }
.car-specs { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 13.5px; }
.car-specs span { display: inline-flex; align-items: center; gap: 5px; }
.car-features { display: flex; flex-wrap: wrap; gap: 6px; }
.car-features span {
  font-size: 12px; padding: 3px 9px; border-radius: 6px;
  background: var(--surface-2); color: var(--muted);
}
.car-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.car-price strong { font-size: 24px; font-weight: 800; }
.car-price span { color: var(--muted); font-size: 13px; }

/* How it works */
.how { background: var(--bg-2); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px;
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041018; font-weight: 800; font-size: 18px;
}
.step h3 { margin: 0 0 8px; font-size: 19px; }
.step p { margin: 0; color: var(--muted); }

/* W razie pytań */
.help { background: var(--bg-2); }
.help-card {
  display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(0, 212, 255, 0.14), transparent 70%),
    var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 44px;
}
.help-text h2 { font-size: clamp(24px, 3.6vw, 34px); margin: 0 0 10px; letter-spacing: -1px; }
.help-text p { margin: 0; color: var(--muted); font-size: 17px; max-width: 520px; }
.btn-phone { font-size: 21px; padding: 18px 34px; letter-spacing: 0.5px; }
.btn-phone svg { width: 20px; height: 20px; }

/* Footer */
.site-footer { padding: 48px 0; border-top: 1px solid var(--border); background: var(--bg); }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-brand .brand-logo { height: 76px; width: auto; margin-bottom: 12px; }
.footer-brand .muted { margin: 0; }
.footer-col h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.6px;
  color: var(--muted); font-weight: 700; margin: 0 0 12px;
}
.footer-col p { margin: 0 0 6px; }
.footer-col address { font-style: normal; color: var(--text); line-height: 1.85; }
.footer-contact { text-align: right; }
.footer-contact a { color: var(--accent); font-weight: 600; }
.muted { color: var(--muted); font-size: 14px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 7, 14, 0.75); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative; width: min(880px, 100%); max-height: 92vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow);
}
.modal-close {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 22px; cursor: pointer; line-height: 1;
}
.modal-close:hover { background: var(--surface); }
.modal-grid { display: grid; grid-template-columns: 300px 1fr; }
.modal-car {
  padding: 28px; background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 12px;
}
.modal-car img { border-radius: 12px; aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.modal-car h3 { margin: 6px 0 0; font-size: 22px; }
.modal-cat { color: var(--accent); font-size: 13px; font-weight: 600; margin: 0; text-transform: uppercase; letter-spacing: 1px; }
.modal-specs { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-direction: column; gap: 6px; }
.modal-specs li { color: var(--muted); font-size: 14px; display: flex; justify-content: space-between; border-bottom: 1px dashed var(--border); padding-bottom: 6px; }
.modal-price { margin-top: auto; }
.modal-price span { font-size: 28px; font-weight: 800; }
.modal-price small { color: var(--muted); }

.modal-form { padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.modal-form h3 { margin: 0 0 4px; font-size: 22px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 14px; font-weight: 600; color: var(--text); }
.field span small { color: var(--muted); font-weight: 400; }
.field input, .field textarea {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; color: var(--text); font-size: 15px; font-family: inherit; width: 100%;
  transition: border-color .15s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field input.invalid, .field textarea.invalid { border-color: var(--danger); }
.field textarea { resize: vertical; }

.estimate {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px;
}
.estimate span { color: var(--muted); font-size: 14px; }
.estimate strong { font-size: 22px; color: var(--accent); }

.form-error {
  background: rgba(255, 107, 107, 0.12); border: 1px solid rgba(255, 107, 107, 0.4);
  color: #ffb4b4; padding: 12px 14px; border-radius: 10px; font-size: 14px;
}
.form-note { color: var(--muted); font-size: 12.5px; margin: 0; text-align: center; }

/* Success */
.modal-success { padding: 56px 32px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.success-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #041018; font-size: 40px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.modal-success h3 { margin: 0; font-size: 26px; }
.modal-success p { color: var(--muted); margin: 0; max-width: 380px; }

/* Responsive */
@media (max-width: 760px) {
  .nav-links { display: none; }
  .brand-logo { height: 40px; }
  .footer-brand .brand-logo { height: 64px; }
  .nav-actions { gap: 12px; }
  .nav-phone { font-size: 14px; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-car { border-right: none; border-bottom: 1px solid var(--border); }
  .row { grid-template-columns: 1fr; }
  .hero {
    padding: 72px 0 60px;
    background-image:
      linear-gradient(180deg, rgba(8, 11, 22, 0.86) 0%, rgba(8, 11, 22, 0.60) 42%, rgba(8, 11, 22, 0.78) 78%, var(--bg) 100%),
      url("/images/hero-fleet-sm.jpg");
    background-position: center, center 62%;
  }
  .hero-stats { gap: 24px; }
  .hero-stats div + div { padding-left: 24px; }
  section { padding: 56px 0; }
  .help-card { padding: 28px; }
  .btn-phone { width: 100%; font-size: 19px; }
  .footer-inner { flex-direction: column; gap: 28px; }
  .footer-contact { text-align: left; }
}

@media (max-width: 460px) {
  .nav-actions .btn { display: none; }
  .nav-phone { font-size: 15px; }
}
