:root {
  --black: #0a0a0a;
  --black-soft: #131313;
  --black-card: #181818;
  --border: #2a2a2a;
  --red: #e10600;
  --red-dark: #a80400;
  --text: #f2f2f2;
  --text-muted: #a3a3a3;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { overflow-x: hidden; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--black);
  color: var(--text);
  font-family: 'Segoe UI', Arial, sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  display: flex;
  align-items: center;
}
.logo-img { height: 56px; width: auto; display: block; }
.main-nav { display: flex; gap: 28px; }
.main-nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.15s;
}
.main-nav a:hover { color: var(--red); }
.header-account { display: flex; gap: 10px; align-items: center; }
.burger { display: none; background: none; border: none; color: var(--text); font-size: 1.6rem; cursor: pointer; }
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--black-soft);
  border-top: 1px solid var(--border);
}
.mobile-nav a { padding: 14px 20px; border-bottom: 1px solid var(--border); }
.mobile-nav.open { display: flex; }

@media (max-width: 860px) {
  .main-nav, .header-account { display: none; }
  .burger { display: block; }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 4px 14px rgba(225, 6, 0, 0.25); }
.btn-primary:hover { background: var(--red-dark); box-shadow: 0 6px 18px rgba(225, 6, 0, 0.35); transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--red); color: var(--red); }
.btn-outline:hover { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); font-size: 0.8rem; padding: 6px 12px; }
.btn-small { padding: 6px 14px; font-size: 0.8rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 110px 0 90px;
  text-align: center;
  background:
    radial-gradient(ellipse at top, rgba(225, 6, 0, 0.15), transparent 60%),
    var(--black);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.025) 0px,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 64px
  );
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
  font-size: 3rem;
  font-weight: 900;
  margin: 0 0 18px;
  letter-spacing: 0.5px;
}
.hero h1 span { color: var(--red); text-shadow: 0 0 18px rgba(225,6,0,0.55); }
.hero p { color: var(--text-muted); font-size: 1.15rem; max-width: 620px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections generiques ---------- */
section { padding: 70px 0; }
.section-alt { background: var(--black-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.section-subtitle { color: var(--text-muted); margin-bottom: 40px; }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 30px; flex-wrap: wrap; gap: 16px; }

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.service-card {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.service-card:hover {
  border-color: var(--red);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(225, 6, 0, 0.14);
}
.service-card .icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border-radius: 10px;
  background: rgba(225, 6, 0, 0.1);
  color: var(--red);
}
.service-card .icon svg { width: 24px; height: 24px; }
.service-card h3 { margin: 0 0 10px; font-size: 1.1rem; }
.service-card p { color: var(--text-muted); font-size: 0.92rem; margin: 0; }

/* ---------- Cartes motos ---------- */
.vehicles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 26px;
}
.vehicle-card {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.vehicle-card:hover {
  border-color: var(--red);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(225, 6, 0, 0.14);
}
.vehicle-photo {
  width: 100%;
  height: 190px;
  background: #0e0e0e center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
}
.vehicle-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
}
.vehicle-status {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--border);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 4px;
}
.vehicle-info { padding: 18px; }
.vehicle-info h3 { margin: 0 0 6px; font-size: 1.05rem; }
.vehicle-meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 12px; }
.vehicle-price { color: var(--red); font-weight: 800; font-size: 1.25rem; }

/* ---------- Filtres ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-chip {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.filter-chip.active, .filter-chip:hover { border-color: var(--red); color: var(--red); }

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.search-bar input[type="text"] { flex: 1; min-width: 220px; }
.search-bar select { width: auto; min-width: 190px; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 36px;
}
.pagination-status { color: var(--text-muted); font-size: 0.85rem; }

/* ---------- Fiche detail moto ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 46px;
  align-items: flex-start;
}
.detail-grid .vehicle-photo { height: 420px; }

/* ---------- Galerie photo ---------- */
.gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.gallery-thumb {
  width: 72px;
  height: 60px;
  border-radius: 6px;
  background: #0e0e0e center/cover no-repeat;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s;
}
.gallery-thumb:hover { border-color: #555; }
.gallery-thumb.active { border-color: var(--red); }

.image-manager {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.image-manager-item {
  position: relative;
  width: 110px;
}
.image-manager-item .thumb {
  width: 110px;
  height: 90px;
  border-radius: 8px;
  background: #0e0e0e center/cover no-repeat;
  border: 2px solid var(--border);
}
.image-manager-item.cover .thumb { border-color: var(--red); }
.image-manager-item .cover-label {
  font-size: 0.68rem;
  color: var(--red);
  font-weight: 700;
  text-align: center;
  margin-top: 4px;
}
.image-manager-item .item-actions {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 4px;
}
.image-manager-item .item-actions button {
  flex: 1;
  font-size: 0.65rem;
  padding: 4px 2px;
  background: var(--black-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
}
.image-manager-item .item-actions button:hover { color: var(--text); border-color: #555; }
.image-manager-item .item-actions button.danger:hover { color: var(--red); border-color: var(--red); }

/* ---------- Formulaires ---------- */
.login-logo { display: block; height: 110px; width: auto; margin: 0 auto 24px; }
.form-card {
  max-width: 520px;
  margin: 0 auto;
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.form-card.wide { max-width: 760px; }
.form-group { margin-bottom: 18px; }
label { display: block; margin-bottom: 6px; font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
label .optional { font-weight: 400; color: #666; }
input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--black-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); }
input.invalid, textarea.invalid { border-color: #ff8a85; }
textarea { resize: vertical; min-height: 110px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 0.9rem; animation: fadeIn 0.2s ease; }
.alert-error { background: rgba(225,6,0,0.12); border: 1px solid var(--red); color: #ff8a85; }
.alert-success { background: rgba(0, 200, 100, 0.1); border: 1px solid #00c864; color: #6fe3ab; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.field-error { display: block; min-height: 16px; margin-top: 5px; font-size: 0.78rem; color: #ff8a85; }

.input-icon { position: relative; display: flex; align-items: center; }
.input-icon svg { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--text-muted); pointer-events: none; }
.input-icon input { padding-left: 40px; }

.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.char-count { font-size: 0.75rem; color: #666; }

.vehicle-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 20px;
  border-radius: 8px;
  background: rgba(225, 6, 0, 0.08);
  border: 1px solid rgba(225, 6, 0, 0.25);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.vehicle-chip svg { width: 20px; height: 20px; color: var(--red); flex-shrink: 0; }
.vehicle-chip strong { color: var(--text); }

/* Piege anti-spam : invisible pour un visiteur, present pour les robots */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

#submitBtn { position: relative; }
#submitBtn.is-loading { opacity: 0.8; cursor: progress; }
#submitBtn.is-loading .btn-label::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: middle;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tableaux (back-office) ---------- */
.dashboard-shell { display: flex; min-height: calc(100vh - 72px); }
.sidebar {
  width: 230px;
  background: var(--black-soft);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  flex-shrink: 0;
}
.sidebar a {
  display: block;
  padding: 12px 24px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  border-left: 3px solid transparent;
}
.sidebar a:hover { color: var(--text); }
.sidebar a.active { color: var(--red); border-left-color: var(--red); background: rgba(225,6,0,0.06); }
.sidebar .sidebar-label { padding: 20px 24px 8px; font-size: 0.72rem; text-transform: uppercase; color: #555; letter-spacing: 1px; }
.dashboard-content { flex: 1; padding: 40px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 20px; margin-bottom: 40px; }
.stat-card {
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.stat-card:hover { border-color: var(--red); box-shadow: 0 8px 22px rgba(225, 6, 0, 0.1); }
.stat-card .value { font-size: 2.2rem; font-weight: 800; color: var(--red); }
.stat-card .label { color: var(--text-muted); font-size: 0.85rem; }

table { width: 100%; border-collapse: collapse; background: var(--black-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--text-muted); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.5px; background: rgba(255, 255, 255, 0.02); }
tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: rgba(225, 6, 0, 0.05); }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.badge-disponible { background: rgba(0,200,100,0.12); color: #6fe3ab; }
.badge-reserve { background: rgba(255,180,0,0.12); color: #ffcf5c; }
.badge-vendu { background: rgba(255,255,255,0.08); color: var(--text-muted); }
.badge-admin { background: rgba(225,6,0,0.15); color: var(--red); }
.badge-employee { background: rgba(255,255,255,0.08); color: var(--text-muted); }
.sold-countdown { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--black-soft); margin-top: 60px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; padding: 50px 0 30px; }
.footer-logo { height: 64px; width: auto; margin-bottom: 12px; }
.footer-inner h4 { font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.footer-inner a, .footer-inner p { display: block; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 6px; }
.footer-bottom { text-align: center; padding: 18px; border-top: 1px solid var(--border); color: #555; font-size: 0.8rem; }

@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr; }
  .dashboard-shell { flex-direction: column; }
  .sidebar { width: 100%; display: flex; overflow-x: auto; padding: 10px; }
  .sidebar .sidebar-label { display: none; }
  .sidebar a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .sidebar a.active { border-left: none; border-bottom-color: var(--red); }
  .form-row { flex-direction: column; gap: 0; }
  .hero { padding: 70px 0 60px; }
  .hero h1 { font-size: 2.1rem; }
  .hero p { font-size: 1rem; }
  section { padding: 40px 0; }
  .section-title { font-size: 1.5rem; }
  .dashboard-content { padding: 20px 16px; }
  .form-card { padding: 22px; }

  .detail-grid { grid-template-columns: 1fr; gap: 20px; }
  .detail-grid .vehicle-photo { height: 240px; }

  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
  .table-scroll table { min-width: 560px; }
}
