/* ════════════════════════════════════════════════════════════════
   AJSLocation — thème vert & blanc, premium, responsive
   ════════════════════════════════════════════════════════════════ */
:root {
  --green:        #1f8a3b;
  --green-dark:   #166a2d;
  --green-darker: #0f4d20;
  --green-light:  #e8f5ec;
  --green-soft:   #f3faf5;
  --accent:       #2fb85a;
  --ink:          #14241a;
  --muted:        #5d6f63;
  --line:         #e0eae2;
  --bg:           #f6f9f6;
  --white:        #ffffff;
  --danger:       #c0392b;
  --warn:         #b8860b;
  --radius:       14px;
  --radius-sm:    9px;
  --shadow:       0 6px 24px rgba(20, 60, 30, .08);
  --shadow-lg:    0 18px 50px rgba(20, 60, 30, .14);
  --maxw:         1180px;
  --font:         system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--ink);
  background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
.app-main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }

/* ── Boutons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .72em 1.4em; border: 0; border-radius: 999px; cursor: pointer;
  font-size: .98rem; font-weight: 600; font-family: inherit; transition: .18s;
  background: var(--green); color: #fff; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--green-dark); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.outline { background: transparent; color: var(--green-dark); box-shadow: inset 0 0 0 2px var(--green); }
.btn.outline:hover { background: var(--green-light); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--green-light); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #9b2c20; }
.btn.sm { padding: .45em .9em; font-size: .85rem; }
.btn.block { width: 100%; }
.btn.lg { padding: .9em 1.8em; font-size: 1.08rem; }

/* ── Header ──────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 18px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.3rem; color: var(--green-dark); }
.brand:hover { text-decoration: none; }
.brand .logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--green), var(--accent)); display: grid; place-items: center; color: #fff; font-weight: 900; }
.brand-logo { height: 44px; width: auto; display: block; }
.footer-logo { height: 56px; width: auto; margin-bottom: 14px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a { padding: .5em .8em; border-radius: 8px; color: var(--ink); font-weight: 500; font-size: .95rem; }
.nav-links a:hover, .nav-links a.active { background: var(--green-light); color: var(--green-dark); text-decoration: none; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch button { border: 0; background: #fff; padding: .35em .7em; cursor: pointer; font-weight: 600; font-size: .8rem; color: var(--muted); }
.lang-switch button.active { background: var(--green); color: #fff; }
.burger { display: none; background: none; border: 0; cursor: pointer; font-size: 1.6rem; color: var(--green-dark); margin-left: auto; }

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--green-darker), var(--green) 60%, var(--accent));
  color: #fff; padding: 70px 0 96px; position: relative; overflow: hidden;
}
.hero::after { content: ""; position: absolute; inset: auto -10% -40% -10%; height: 60%; background: radial-gradient(closest-side, rgba(255,255,255,.12), transparent); }
.hero h1 { color: #fff; max-width: 16ch; }
.hero p { font-size: 1.15rem; max-width: 52ch; opacity: .95; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hero .badge { background: rgba(255,255,255,.16); padding: .5em 1em; border-radius: 999px; font-size: .9rem; font-weight: 600; }

/* ── Barre de recherche ──────────────────────────────────────── */
.search-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 18px; margin-top: 28px; display: grid; gap: 12px;
  grid-template-columns: repeat(4, 1fr) auto; align-items: end;
}
.search-card.inline { margin-top: -56px; position: relative; z-index: 5; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field input, .field select, .field textarea {
  padding: .7em .8em; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: .95rem; font-family: inherit; background: #fff; color: var(--ink); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
textarea {
  resize: vertical; min-height: 110px; width: 100%; box-sizing: border-box;
  padding: .7em .8em; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: .95rem; font-family: inherit; background: #fff; color: var(--ink);
}
textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

/* ── Sections & grilles ──────────────────────────────────────── */
section.block { padding: 56px 0; }
.section-head { margin-bottom: 28px; }
.grid { display: grid; gap: 22px; }
.grid.cars { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* ── Cartes véhicules ────────────────────────────────────────── */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: .2s; }
.car-card { display: flex; flex-direction: column; }
.car-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.car-thumb { aspect-ratio: 16/10; background: linear-gradient(135deg, var(--green-light), #dff0e4); display: grid; place-items: center; color: var(--green-dark); position: relative; }
.car-thumb img { width: 100%; height: 100%; object-fit: cover; }
.car-thumb .ph { font-size: 3rem; opacity: .5; }
.car-cat { position: absolute; top: 10px; left: 10px; background: rgba(255,255,255,.92); color: var(--green-dark); font-size: .72rem; font-weight: 700; padding: .3em .7em; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.car-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.car-body h3 { margin: 0; font-size: 1.15rem; }
.car-specs { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: .85rem; color: var(--muted); }
.car-specs span { display: inline-flex; align-items: center; gap: 4px; }
.car-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.price { font-size: 1.4rem; font-weight: 800; color: var(--green-dark); }
.price small { font-size: .75rem; font-weight: 600; color: var(--muted); }
.unavailable { opacity: .55; }
.tag-unavail { background: #fdecea; color: var(--danger); font-size: .72rem; font-weight: 700; padding: .3em .7em; border-radius: 999px; }

/* ── Feature / trust ─────────────────────────────────────────── */
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; text-align: center; }
.feature .ico { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px; background: var(--green-light); display: grid; place-items: center; font-size: 1.6rem; }

/* ── Fiche véhicule ──────────────────────────────────────────── */
.detail { display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; }
.gallery { display: flex; flex-direction: column; gap: 12px; }
.gallery .main { aspect-ratio: 16/10; border-radius: var(--radius); overflow: hidden; background: var(--green-light); display: grid; place-items: center; }
.gallery .thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery .thumbs img { width: 84px; height: 60px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.gallery .thumbs img.active { border-color: var(--green); }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.spec-grid .item { background: var(--green-soft); border-radius: var(--radius-sm); padding: 12px 14px; }
.spec-grid .item b { display: block; font-size: 1.05rem; }
.spec-grid .item span { font-size: .8rem; color: var(--muted); }

/* ── Réservation / récapitulatif ─────────────────────────────── */
.booking-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; }
.summary { position: sticky; top: 84px; }
.summary .line { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.summary .line.total { border-bottom: 0; font-size: 1.25rem; font-weight: 800; color: var(--green-dark); padding-top: 14px; }
.summary .due { background: var(--green-light); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 12px; }
.option-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; }
.option-row input { width: 18px; height: 18px; accent-color: var(--green); }
.option-row .meta { flex: 1; }
.option-row .opx { font-weight: 700; color: var(--green-dark); }

/* ── Panels / cards génériques ───────────────────────────────── */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.panel + .panel { margin-top: 20px; }
.panel h2, .panel h3 { margin-top: 0; }

/* ── Formulaires / auth ──────────────────────────────────────── */
.auth-wrap { max-width: 440px; margin: 48px auto; }
.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.error-msg { background: #fdecea; color: var(--danger); padding: .7em 1em; border-radius: var(--radius-sm); font-size: .9rem; }
.success-msg { background: var(--green-light); color: var(--green-darker); padding: .7em 1em; border-radius: var(--radius-sm); font-size: .9rem; }

/* ── Badges de statut ────────────────────────────────────────── */
.status { display: inline-block; padding: .25em .7em; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.status.pending_payment { background: #fff4e0; color: #95620a; }
.status.deposit_paid { background: #e3f0ff; color: #1d5fae; }
.status.paid, .status.confirmed { background: var(--green-light); color: var(--green-darker); }
.status.completed { background: #eef0f2; color: #51606e; }
.status.cancelled { background: #fdecea; color: var(--danger); }

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { background: var(--green-soft); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.data tr:hover td { background: var(--green-soft); }

/* ── Admin layout ────────────────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 230px 1fr; gap: 24px; align-items: start; }
.admin-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; position: sticky; top: 84px; }
.admin-nav a { display: block; padding: .6em .8em; border-radius: 8px; color: var(--ink); font-size: .92rem; font-weight: 500; }
.admin-nav a:hover, .admin-nav a.active { background: var(--green-light); color: var(--green-dark); text-decoration: none; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.kpi .v { font-size: 1.9rem; font-weight: 800; color: var(--green-dark); }
.kpi .l { font-size: .82rem; color: var(--muted); }

/* ── Diagnostics ─────────────────────────────────────────────── */
.diag-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); }
.dot { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: .85rem; }
.dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; }
.dot.configured { color: var(--green-dark); } .dot.configured::before { background: var(--accent); }
.dot.missing { color: var(--danger); } .dot.missing::before { background: var(--danger); }
.dot.invalid { color: var(--warn); } .dot.invalid::before { background: var(--warn); }

/* ── Toast & modal ───────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: .8em 1.3em; border-radius: 999px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .25s; z-index: 200; font-weight: 600; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--green-dark); }
.modal-overlay { position: fixed; inset: 0; background: rgba(15,40,25,.5); display: grid; place-items: center; z-index: 150; padding: 20px; }
.modal-overlay[hidden] { display: none !important; }
.modal { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; }
.modal header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal header h3 { margin: 0; }
.modal .body { padding: 22px; }
.modal .foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.modal .close { background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--muted); line-height: 1; }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer { background: var(--green-darker); color: #d8ecdd; margin-top: 60px; padding: 48px 0 24px; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { color: #fff; margin: 0 0 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.footer-bottom { margin-top: 32px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.15); font-size: .85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

.loader { text-align: center; padding: 80px 20px; color: var(--muted); }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }

/* ── Fiche véhicule enrichie ─────────────────────────────────── */
.vd-section { margin-top: 42px; }
.vd-section > h2 { position: relative; padding-bottom: 8px; margin-bottom: 20px; }
.vd-section > h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 54px; height: 3px; background: var(--green); border-radius: 2px; }
.reassure { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; }
.reassure .r { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.equip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.equip { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.equip .eq-ic { font-size: 1.2rem; }
.equip .eq-l { color: var(--muted); font-size: .9rem; }
.equip .eq-v { margin-left: auto; font-weight: 700; text-transform: capitalize; }
.cta-band { margin-top: 44px; background: linear-gradient(135deg, var(--green-darker), var(--green) 70%, var(--accent)); color: #fff; border-radius: var(--radius); padding: 36px 24px; text-align: center; box-shadow: var(--shadow); }
.cta-band h2 { color: #fff; margin: 0 0 6px; }
.cta-band p { opacity: .95; margin: 0 0 18px; }

/* ── Pages légales ───────────────────────────────────────────── */
.legal-doc { max-width: 860px; }
.legal-doc h2 { font-size: 1.15rem; margin: 24px 0 8px; color: var(--green-dark); }
.legal-doc p, .legal-doc li { line-height: 1.7; }
.legal-doc ul { padding-left: 20px; margin: 8px 0; }
.legal-doc code { background: var(--green-soft); padding: 1px 6px; border-radius: 4px; font-size: .88em; }
.legal-doc .todo { color: var(--warn); font-weight: 600; }

/* ── Partenaires ─────────────────────────────────────────────── */
.partners-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.partner-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 22px 16px; border-radius: var(--radius); border: 1px solid transparent; transition: .2s; text-decoration: none; }
.partner-card:hover { border-color: var(--line); box-shadow: var(--shadow); background: #fff; transform: translateY(-3px); text-decoration: none; }
.partner-logo { height: 96px; display: flex; align-items: center; justify-content: center; }
.partner-logo img { max-height: 96px; max-width: 180px; width: auto; object-fit: contain; filter: grayscale(35%); transition: .2s; }
.partner-card:hover .partner-logo img { filter: grayscale(0); }
.partner-name { font-weight: 800; color: var(--green-dark); font-size: 1.15rem; }
.partner-desc { color: var(--muted); font-size: .9rem; margin: 0; max-width: 30ch; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 920px) {
  .detail, .booking-layout, .admin-layout { grid-template-columns: 1fr; }
  .summary, .admin-nav { position: static; }
  .search-card { grid-template-columns: 1fr 1fr; }
  .admin-nav { display: flex; flex-wrap: wrap; gap: 6px; }
  .admin-nav a { flex: 1 1 auto; text-align: center; }
}
@media (max-width: 720px) {
  .nav-links { display: none; position: absolute; top: 66px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 12px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; }
  .burger { display: block; }
  .brand-logo { height: 36px; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .search-card { grid-template-columns: 1fr; }
  .spec-grid { grid-template-columns: 1fr; }
}
