/* ============================================================
   DriveNow — Location de véhicules
   Feuille de style partagée (visiteur + admin)
   ============================================================ */

:root {
  --bg: #0b1020;
  --bg-soft: #11182e;
  --surface: #ffffff;
  --surface-2: #f4f6fb;
  --ink: #0f1729;
  --ink-soft: #475069;
  --muted: #8a93ab;
  --line: #e6e9f2;
  --brand: #4f7cff;
  --brand-dark: #2f5be0;
  --brand-soft: #eaf0ff;
  --accent: #16c79a;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 10px 30px rgba(17, 24, 46, .08);
  --shadow-lg: 0 24px 60px rgba(17, 24, 46, .16);
  --radius: 16px;
  --radius-sm: 11px;
  --maxw: 1180px;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--surface-2);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Plus Jakarta Sans', sans-serif; line-height: 1.15; color: var(--ink); }

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

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s, color .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(79,124,255,.35); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { color: var(--brand); }
.btn-light { background: #fff; color: var(--brand); }
.btn-light:hover { background: #eef2ff; }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13.5px; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-block { width: 100%; }

/* ============================================================
   HEADER PUBLIC
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.site-header.scrolled { border-color: var(--line); box-shadow: 0 4px 20px rgba(17,24,46,.06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }

.logo { display: inline-flex; align-items: center; gap: 9px; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 21px; letter-spacing: -.4px; }
.logo span { color: var(--brand); }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #7aa0ff); color: #fff; font-size: 18px;
}

.main-nav { display: flex; gap: 30px; }
.main-nav a { font-weight: 500; color: var(--ink-soft); font-size: 15px; transition: color .2s; }
.main-nav a:hover { color: var(--brand); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, #0b1020, #161f3d); color: #fff; }
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 300px at 80% -10%, rgba(79,124,255,.45), transparent 60%),
    radial-gradient(500px 300px at 10% 110%, rgba(22,199,154,.25), transparent 60%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 50px; align-items: center; padding: 80px 24px 90px; }
.eyebrow { display: inline-block; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; margin-bottom: 22px; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 800; letter-spacing: -1.2px; color: #fff; }
.hero h1 .grad { background: linear-gradient(90deg, #7aa0ff, #16c79a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: #c4cce0; font-size: 18px; margin: 20px 0 30px; max-width: 520px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-trust { list-style: none; display: flex; gap: 26px; margin-top: 34px; flex-wrap: wrap; }
.hero-trust li { font-size: 14px; color: #c4cce0; }
.hero-trust strong { color: #fff; }

/* Recherche rapide dans le hero */
.hero-search {
  margin-top: 30px; background: #fff; border-radius: var(--radius); padding: 16px;
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; box-shadow: var(--shadow-lg);
}
.hero-search label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .4px; }
.hero-search select, .hero-search input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px;
  font: inherit; color: var(--ink); background: var(--surface-2);
}
.hero-search .btn { align-self: end; height: 42px; }

.hero-visual { position: relative; }
.car-showcase {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px; padding: 34px; backdrop-filter: blur(6px);
}
.car-showcase .big-car { font-size: 120px; text-align: center; line-height: 1; filter: drop-shadow(0 20px 30px rgba(0,0,0,.4)); }
.car-showcase .cs-row { display: flex; justify-content: space-between; margin-top: 24px; gap: 12px; }
.car-showcase .cs-row > div { flex: 1; background: rgba(255,255,255,.07); border-radius: 12px; padding: 12px; text-align: center; }
.car-showcase .cs-row b { display: block; font-size: 18px; color: #fff; }
.car-showcase .cs-row small { color: #aab4cf; font-size: 12px; }
.float-badge { position: absolute; background: #fff; color: var(--ink); font-weight: 600; font-size: 13px; padding: 8px 14px; border-radius: 999px; box-shadow: var(--shadow-lg); }
.badge-1 { top: 10px; right: -6px; }
.badge-2 { bottom: 20px; left: -10px; }

/* ============================================================
   SECTIONS GÉNÉRIQUES
   ============================================================ */
.section { padding: 80px 0; }
.section-alt { background: #fff; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 50px; }
.kicker { color: var(--brand); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); margin: 10px 0 14px; letter-spacing: -.6px; }
.section-head p { color: var(--ink-soft); font-size: 17px; }

/* ---------- Avantages ---------- */
.perks-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.perk { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; text-align: center; box-shadow: var(--shadow); }
.perk .pi { font-size: 32px; }
.perk h3 { font-size: 17px; margin: 12px 0 6px; }
.perk p { color: var(--ink-soft); font-size: 14.5px; }

/* ============================================================
   CATALOGUE VÉHICULES
   ============================================================ */
.catalog-toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 34px; box-shadow: var(--shadow);
}
.catalog-toolbar select, .catalog-toolbar input[type="search"] {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px;
  font: inherit; color: var(--ink); background: var(--surface-2); min-width: 150px;
}
.catalog-toolbar .field { display: flex; flex-direction: column; gap: 4px; }
.catalog-toolbar .field small { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding-left: 4px; }
.result-count { width: 100%; text-align: center; color: var(--ink-soft); margin-bottom: 18px; font-size: 14.5px; }

.cars-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.car-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.car-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.car-thumb { height: 150px; display: grid; place-items: center; font-size: 72px; position: relative; }
.car-badge { position: absolute; top: 12px; left: 12px; background: rgba(0,0,0,.35); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; backdrop-filter: blur(4px); }
.car-dispo { position: absolute; top: 12px; right: 12px; font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; }
.car-dispo.ok { background: #dcfce7; color: #15803d; }
.car-dispo.no { background: #fee2e2; color: #b91c1c; }
.car-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.car-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.car-title h3 { font-size: 18px; }
.car-title .price b { font-size: 20px; color: var(--brand); }
.car-title .price small { color: var(--muted); font-size: 12px; }
.car-specs { display: flex; flex-wrap: wrap; gap: 8px; }
.car-specs span { background: var(--surface-2); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; color: var(--ink-soft); }
.car-card .btn { margin-top: auto; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); grid-column: 1/-1; }
.empty-state .ei { font-size: 46px; }

/* ============================================================
   MODALE
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(8,12,26,.55); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: 20px; width: 100%; max-width: 540px; max-height: 90vh;
  overflow: auto; box-shadow: var(--shadow-lg); animation: pop .25s cubic-bezier(.16,.84,.44,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.modal-head h3 { font-size: 19px; }
.modal-close { background: var(--surface-2); border: none; width: 34px; height: 34px; border-radius: 9px; font-size: 18px; cursor: pointer; color: var(--ink-soft); }
.modal-close:hover { background: #e7eaf3; }
.modal-body { padding: 24px; }
.modal-car-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.modal-car-head .mch-emoji { width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center; font-size: 34px; color: #fff; }
.modal-car-head h4 { font-size: 20px; }
.modal-car-head p { color: var(--ink-soft); font-size: 14px; }

/* ---------- Formulaires ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.form-field input, .form-field select, .form-field textarea {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px;
  font: inherit; color: var(--ink); background: var(--surface-2); width: 100%;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft);
}
.form-field textarea { resize: vertical; min-height: 80px; }

.booking-summary { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px 16px; margin: 18px 0; }
.booking-summary .bs-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-soft); padding: 3px 0; }
.booking-summary .bs-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 18px; color: var(--ink); border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 10px; }

.flash { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; margin-top: 14px; display: none; }
.flash.show { display: block; }
.flash.ok { background: #dcfce7; color: #15803d; }
.flash.err { background: #fee2e2; color: #b91c1c; }

/* ============================================================
   CTA + FOOTER
   ============================================================ */
.cta-final { background: linear-gradient(135deg, var(--brand), #6b8dff); color: #fff; text-align: center; padding: 70px 0; }
.cta-final h2 { color: #fff; font-size: clamp(26px, 3.5vw, 38px); }
.cta-final p { color: #e3eaff; font-size: 17px; margin: 12px auto 26px; max-width: 540px; }

.site-footer { background: #0b1020; color: #aab4cf; padding: 54px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.footer-brand .logo { color: #fff; margin-bottom: 14px; }
.footer-brand p { font-size: 14px; max-width: 280px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 14px; padding: 5px 0; transition: color .2s; }
.footer-col a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,.1); margin-top: 36px; padding-top: 22px; font-size: 13px; flex-wrap: wrap; gap: 12px; }
.footer-legal { display: flex; gap: 18px; }

/* ============================================================
   RÉVÉLATIONS AU SCROLL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   ADMIN — LOGIN
   ============================================================ */
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #0b1020, #1a2547); padding: 24px; }
.login-card { background: #fff; border-radius: 20px; padding: 38px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }
.login-card .logo { justify-content: center; margin-bottom: 6px; }
.login-card .login-sub { text-align: center; color: var(--ink-soft); margin-bottom: 26px; font-size: 14.5px; }
.login-card .form-field { margin-bottom: 16px; }
.login-hint { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 18px; }
.login-hint code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; color: var(--ink); }
.back-link { display: inline-block; margin-top: 18px; text-align: center; width: 100%; color: var(--muted); font-size: 13px; }
.back-link:hover { color: var(--brand); }

/* ============================================================
   ADMIN — LAYOUT
   ============================================================ */
.admin-body { background: var(--surface-2); }
.admin-layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

.sidebar { background: #0b1020; color: #c4cce0; padding: 24px 18px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.sidebar .logo { color: #fff; margin-bottom: 32px; padding: 0 6px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 11px; font-weight: 500; font-size: 15px; color: #aab4cf; transition: .2s; cursor: pointer; }
.side-nav a .si { font-size: 18px; width: 22px; text-align: center; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: var(--brand); color: #fff; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.1); padding-top: 16px; }
.sidebar-foot .who { font-size: 13px; color: #8a93ab; padding: 0 6px 12px; }
.sidebar-foot .who b { color: #fff; display: block; font-size: 14px; }

.admin-main { padding: 0; overflow: auto; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 18px 32px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 20; }
.admin-topbar h1 { font-size: 22px; }
.admin-topbar .sub { color: var(--muted); font-size: 13.5px; }
.admin-content { padding: 32px; }

.admin-view { display: none; }
.admin-view.active { display: block; animation: fade .25s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Cartes de stats ---------- */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
.stat-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.stat-box .sb-top { display: flex; justify-content: space-between; align-items: center; }
.stat-box .sb-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; }
.stat-box .sb-icon.blue { background: var(--brand-soft); }
.stat-box .sb-icon.green { background: #dcfce7; }
.stat-box .sb-icon.amber { background: #fef3c7; }
.stat-box .sb-icon.violet { background: #ede9fe; }
.stat-box .sb-value { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 30px; font-weight: 800; margin-top: 14px; letter-spacing: -.5px; }
.stat-box .sb-label { color: var(--muted); font-size: 14px; }

/* ---------- Panneaux & tables ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 26px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; gap: 12px; }
.panel-head h2 { font-size: 18px; }
.panel-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.panel-tools input, .panel-tools select { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; font: inherit; background: var(--surface-2); }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th { text-align: left; padding: 13px 22px; background: var(--surface-2); color: var(--ink-soft); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
table.data td { padding: 14px 22px; border-top: 1px solid var(--line); vertical-align: middle; }
table.data tr:hover td { background: #fafbff; }
.cell-car { display: flex; align-items: center; gap: 12px; }
.cell-car .cc-emoji { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; color: #fff; flex-shrink: 0; }
.cell-car b { display: block; }
.cell-car small { color: var(--muted); }

.tag { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.tag.ok { background: #dcfce7; color: #15803d; }
.tag.no { background: #fee2e2; color: #b91c1c; }
.tag.wait { background: #fef3c7; color: #92651b; }
.tag.info { background: var(--brand-soft); color: var(--brand-dark); }

.row-actions { display: flex; gap: 7px; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 15px; display: grid; place-items: center; transition: .15s; }
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.icon-btn.del:hover { border-color: var(--danger); color: var(--danger); background: #fef2f2; }

.toast { position: fixed; bottom: 26px; right: 26px; background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14.5px; font-weight: 500; z-index: 200; transform: translateY(120%); opacity: 0; transition: .3s cubic-bezier(.16,.84,.44,1); }
.toast.show { transform: none; opacity: 1; }
.toast.ok { background: #15803d; }
.toast.err { background: var(--danger); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .main-nav { position: absolute; top: 70px; left: 0; right: 0; background: #fff; flex-direction: column; gap: 0; padding: 8px 24px 18px; box-shadow: var(--shadow); display: none; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: flex; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 380px; margin: 0 auto; }
  .perks-grid { grid-template-columns: repeat(2, 1fr); }
  .cars-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; gap: 14px; padding: 12px 16px; overflow-x: auto; }
  .sidebar .logo { margin: 0; white-space: nowrap; }
  .side-nav { flex-direction: row; flex: 1; }
  .side-nav a span.txt { display: none; }
  .sidebar-foot { border: none; padding: 0; }
  .sidebar-foot .who { display: none; }
}
@media (max-width: 640px) {
  .hero-search { grid-template-columns: 1fr; }
  .cars-grid { grid-template-columns: 1fr; }
  .perks-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .admin-content { padding: 18px; }
  .admin-topbar { padding: 16px 18px; }
}
