:root {
  color-scheme: dark;
  --bg: #080b0f;
  --panel: #10171e;
  --field: #0b1117;
  --line: #26343f;
  --ink: #f3f6f9;
  --muted: #a9b7c2;
  --cyan: #60e6f4;
  --gold: #f4ca78;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 20px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, sans-serif; }
h1, h2, h3, p, figure { margin: 0; }
a { color: var(--cyan); text-underline-offset: 4px; }
a:hover { text-decoration: none; }
.wrap { width: min(1280px, calc(100% - 48px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); background: #090d12; }
.top { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 780; line-height: 1.15; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; font-weight: 550; }
.monogram { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #75603f; border-radius: 10px; color: var(--gold); background: #211b13; font-size: .88rem; letter-spacing: .05em; }
.nav-action { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-size: .84rem; font-weight: 680; }
.nav-action:hover { border-color: var(--cyan); }

.hero { display: grid; grid-template-columns: minmax(0, .87fr) minmax(0, 1.13fr); min-height: 410px; margin: 26px 0 42px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: radial-gradient(ellipse at 3% 0%, #16313a, transparent 62%), #10161d; }
.hero-copy { align-self: center; padding: clamp(24px, 4.2vw, 60px); }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--cyan); font-size: .7rem; font-weight: 760; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow::before { content: ''; width: 17px; height: 1px; background: var(--cyan); }
h1 { margin: 11px 0 16px; font-size: clamp(2.5rem, 5.3vw, 5rem); line-height: .98; letter-spacing: -.065em; }
h1 span { color: var(--gold); }
.hero-description { max-width: 37ch; color: var(--muted); }
.hero-action { display: inline-flex; gap: 12px; align-items: center; min-height: 45px; margin-top: 22px; padding: 8px 15px; border-radius: 8px; text-decoration: none; }
.hero-media { position: relative; display: grid; align-items: end; min-height: 255px; isolation: isolate; background: #14252d; overflow: hidden; }
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, #070c12 0%, transparent 62%), linear-gradient(90deg, #10161d 0%, transparent 26%); }
.hero-media figcaption { position: relative; z-index: 1; justify-self: end; padding: 24px; text-align: right; }
.hero-media figcaption span, .hero-media figcaption strong { display: block; }
.hero-media figcaption span { color: var(--gold); text-transform: uppercase; font-size: .67rem; font-weight: 750; letter-spacing: .13em; }
.hero-media figcaption strong { font-size: 1.16rem; }
.section-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; }
.section-heading h2 { margin-top: 4px; font-size: clamp(1.65rem, 3vw, 2.4rem); line-height: 1.1; letter-spacing: -.04em; }
#status { padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: .82rem; }
.filters { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 12px; padding: 13px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: .8rem; font-weight: 620; }
input, select, button { min-height: 44px; min-width: 0; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font: inherit; }
input, select { width: 100%; font-size: 1rem; }
button { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--cyan); }
button:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.search-field { position: relative; display: block; }
.search-field svg { position: absolute; top: 11px; left: 10px; width: 21px; color: var(--cyan); pointer-events: none; }
.search-field input { padding-inline-start: 37px; }

#grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 24px; }
#grid article { display: flex; flex-direction: column; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
@media (hover: hover) {
  #grid article:hover { border-color: #457481; }
}
#grid figure { display: grid; place-items: center; aspect-ratio: 16/10; overflow: hidden; background: #17232b; color: var(--muted); font-size: .8rem; }
#grid img { width: 100%; height: 100%; object-fit: cover; }
.info { flex: 1; display: flex; flex-direction: column; align-items: start; padding: 13px; }
.category { padding: 2px 6px; border-radius: 4px; background: #16313a; color: var(--cyan); font-size: .67rem; font-weight: 730; overflow-wrap: anywhere; }
.info h3 { margin: 7px 0 8px; font-size: 1rem; line-height: 1.22; overflow-wrap: anywhere; }
.price { margin-top: auto; color: var(--gold); font-size: 1.12rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.specs { width: 100%; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.specs:empty { display: none; }
.empty-state { grid-column: 1/-1; color: var(--muted); padding: 16px 0; }
nav[aria-label="Pagination"], nav[aria-label="Pages de véhicules"] { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; }
nav[hidden] { display: none; }
#page, #page-label { color: var(--muted); font-variant-numeric: tabular-nums; }
.site-footer { margin-top: 38px; padding: 20px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.manage { padding-block: 28px 40px; }
.manage h1 { font-size: clamp(2.8rem, 7vw, 4.6rem); }
.manage > p:not(.eyebrow) { color: var(--muted); }
.manage section, .manage dialog { padding: clamp(13px, 2.5vw, 22px); margin: 15px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.manage section h2 { margin-bottom: 10px; font-size: 1.3rem; }
.row { display: flex; flex-wrap: wrap; gap: 9px; align-items: end; }
.row label { flex: 1 1 175px; }
.manage-heading { justify-content: space-between; align-items: center; margin-bottom: 12px; }
.manage .manage-heading h2 { margin: 0; }
.primary { background: var(--gold); border-color: var(--gold); color: #16120c; font-weight: 780; }
.primary:hover { background: #ffdb97; }
.manage dialog { width: min(610px, calc(100% - 22px)); max-height: 90dvh; margin: auto; color: var(--ink); }
dialog::backdrop { background: #000c; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.wide { grid-column: 1/-1; }
.checks { display: flex; gap: 12px; flex-wrap: wrap; }
.checks label { display: flex; align-items: center; gap: 5px; min-height: 36px; }
.checks input { width: auto; min-height: auto; accent-color: var(--cyan); }
#results { list-style: none; padding: 0; margin: 10px 0; }
#results li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
#results small, #edit-error, #status-admin { display: block; color: var(--muted); }
#edit-error, #status-admin { margin: 8px 0; min-height: 1.5em; }
#photo-preview { max-width: 150px; max-height: 90px; object-fit: contain; }

@media (max-width: 1050px) { #grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 740px) {
  .wrap { width: calc(100% - 28px); }
  .top { min-height: 65px; }
  .hero { grid-template-columns: 1fr; margin: 14px 0 28px; min-height: 0; }
  .hero-copy { padding: 22px; }
  .hero-media { min-height: 0; aspect-ratio: 16/8; }
  .hero-media::after { background: linear-gradient(0deg, #070c12, transparent 58%); }
  .hero-media figcaption { padding: 12px 16px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
  .filters label:first-child { grid-column: 1/-1; }
  #grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .info { padding: 9px; }
  .price { font-size: 1rem; }
  .nav-action { padding: 6px 8px; font-size: .76rem; }
}
@media (max-width: 340px) { #grid { grid-template-columns: 1fr; } }
