/* Font del brand ospitati in locale: nessuna chiamata a Google Fonts dal browser
   dell'utente (vedi privacy policy: nessun trasferimento di dati a terzi). */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/fonts/fraunces-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Design token DFP Motors — fonte: 03-Brand-Guide/tokens.css */
:root {
  color-scheme: light;

  --grafite: #1a1d1a;
  --grafite-hover: #2c302c;
  --grafite-press: #0e100e;
  --avorio: #f3efe7;
  --ottone: #a87c4f;
  --ottone-hover: #b98e60;
  --ottone-press: #8e663d;
  --pietra: #8a8a82;

  --bg: #fbf9f4;
  --bg-subtle: #f3efe7;
  --text: #1a1d1a;
  /* Grigio pietra scurito: #8a8a82 su Avorio dà ~2.6:1, sotto la soglia AA per
     il testo piccolo. Il pietra originale resta per bordi e segni decorativi. */
  --text-muted: #66665f;
  --border: #e7e1d5;
  --accent: #a87c4f;
  --accent-text: #f3efe7;
  --card-shadow: 0 1px 2px rgba(26, 29, 26, 0.05), 0 1px 3px rgba(26, 29, 26, 0.07);

  --font-display: "Fraunces", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 10px;
  --radius-card: 12px;

  font-family: var(--font-sans);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;   /* aria editoriale, brand guide §4 */
  overflow-x: hidden;
}

/* Titoli in serif, testo e interfaccia in Inter */
h1, h2, h3,
.price-box-final,
.vehicle-cta-price {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.005em;
}

.vin, .plate {
  font-family: var(--font-mono);
}

a {
  color: var(--accent);
}

/* header sticky: evita che l'ancora finisca sotto la barra */
:target {
  scroll-margin-top: 5rem;
}

img {
  max-width: 100%;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Menu mobile: checkbox nascosta + label come pulsante burger, nessun JS */
.nav-toggle-input {
  display: none;
}

.site-nav-toggle {
  display: none;
}

.site-header nav {
  justify-self: center;
  display: flex;
  gap: 1.5rem;
}

.site-header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-header-aside {
  color: var(--text-muted);
  text-decoration: none;
}

.site-header-aside:hover {
  color: var(--accent);
}

.site-header-user {
  position: relative;
}

.site-header-user summary {
  list-style: none;
}

.site-header-user summary::-webkit-details-marker {
  display: none;
}

.site-header-user[open] summary {
  border-color: var(--accent);
  color: var(--accent);
}

.site-header-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  box-shadow: var(--card-shadow);
  z-index: 200;
}

.site-header-menu-label {
  color: var(--text);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}

.site-header-menu a,
.site-header-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  font-size: 0.875rem;
  cursor: pointer;
}

.site-header-menu a:hover,
.site-header-menu button:hover {
  background: var(--bg-subtle);
  color: var(--accent);
}

.site-header-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}

.site-header-signin:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.site-header-signin svg {
  width: 18px;
  height: 18px;
}

.site-header a {
  text-decoration: none;
  font-weight: 500;
  color: var(--text);
}

.site-logo {
  display: block;
  line-height: 0;
}

.site-logo img {
  display: block;
  height: 44px;
  width: auto;
}

.site-header nav a {
  color: var(--text-muted);
}

.site-header nav a:hover {
  color: var(--accent);
}

/* Footer su fondo Grafite con marchio in negativo (brand guide §2, varianti) */
.site-footer {
  padding: 2.5rem 2rem;
  text-align: center;
  background: var(--grafite);
  color: rgba(243, 239, 231, 0.68);
  font-size: 0.875rem;
  margin-top: 4rem;
}

.site-footer p {
  margin: 0.25rem 0;
}

.site-footer a {
  color: var(--avorio);
}

.site-footer-logo {
  display: inline-block;
  margin-bottom: 1.25rem;
  line-height: 0;
}

.site-footer-logo img {
  height: 84px;   /* la variante negativa ha margini interni generosi */
  width: auto;
}

/* Disclaimer legale WLTP/NEDC — sotto il footer */
.legal-disclaimer {
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  padding: 1.25rem 2rem 2rem;
  color: var(--text-muted);
  font-size: 0.6875rem;
  line-height: 1.45;
}

.legal-disclaimer-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.legal-disclaimer h2 {
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.legal-disclaimer p {
  margin: 0.75rem 0 0;
  text-align: justify;
}

.legal-disclaimer-ref {
  font-weight: 600;
  margin-right: 0.25rem;
}

.legal-disclaimer a {
  color: inherit;
  text-decoration: underline;
  word-break: break-word;
}

main {
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  min-height: calc(100vh - 200px);
}

h1 {
  font-size: 1.75rem;
  margin: 0 0 1.5rem;
}

/* Hero (home) — full-bleed, esce dal contenitore .main */
.hero {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: -2rem;
  padding: 6rem 2rem 5rem;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(26, 29, 26, 0.72), rgba(26, 29, 26, 0.88)),
    url("/static/img/hero.png") center 65% / cover no-repeat;
  color: #ffffff;
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.12);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: 3rem;
  line-height: 1.1;
  margin: 0 0 0.75rem;
  color: #ffffff;
}

.hero p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.15rem;
  margin: 0 0 2rem;
}

.hero-search {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  background: var(--bg);
  padding: 0.6rem;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(14, 16, 14, 0.35);
}

.hero-search input {
  flex: 1;
  min-width: 130px;
  border: none;
  background: transparent;
}

.hero-search input:focus {
  outline: none;
  background: var(--bg-subtle);
  border-radius: 6px;
}

.hero-search .btn {
  flex-shrink: 0;
}

.hero-link {
  display: inline-block;
  margin-top: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.925rem;
  text-decoration: none;
}

.hero-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .hero {
    padding: 4rem 1.25rem 3rem;
  }

  .hero h1 {
    font-size: 2.1rem;
  }

  .hero-search {
    flex-direction: column;
  }
}

/* Categorie (home) */
.body-columns {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2.5rem;
  padding: 0 2rem;
  border-top: 1px solid var(--border);
}

.body-main {
  width: 100%;
  max-width: 1100px;
}

.body-sidebar {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 5rem;
  padding-top: 3.5rem;
}

@media (max-width: 1500px) {
  .body-columns {
    flex-direction: column;
    align-items: center;
    padding: 0 2rem;
  }

  .body-sidebar {
    position: static;
    width: 100%;
    max-width: 1100px;
  }

  /* i filtri restano affiancati ai risultati fino a 1100px: impilarli qui
     vorrebbe dire un pannello larghissimo sopra la griglia */
  .body-columns--filters {
    flex-direction: row;
    align-items: flex-start;
  }

  .body-sidebar--filters {
    position: sticky;
    width: 300px;
    max-width: 300px;
  }
}

.categories {
  padding: 3.5rem 0 1rem;
}

.categories h2 {
  font-size: 1.4rem;
  margin: 0 0 1.25rem;
  text-align: center;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.category-card:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.category-icon {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.category-card:hover .category-icon {
  color: var(--accent);
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-text);
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--ottone-hover);
}

.btn:active {
  background: var(--ottone-press);
}

/* Catalogo: stessa impostazione a colonne della home, con la sidebar a sinistra */
.body-columns--filters {
  border-top: 0;
}

.body-sidebar--filters {
  padding-top: 0;
}

.filters-toggle-input,
.filters-toggle {
  display: none;
}

.filters-form {
  display: grid;
  gap: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle);
}

.filters-group {
  display: grid;
  gap: 0.6rem;
}

.filters-group + .filters-group {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.filters-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* label a blocco, non flex: dentro c'è testo inline (es. CO<sub>2</sub>) che
   come flex item finirebbe su una riga a sé */
.filters-form label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.filters-form input,
.filters-form select {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 0.3rem;
  background: var(--bg);
}

.filters-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.filters-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}

.filters-check input {
  display: inline-block;
  width: auto;
  margin-top: 0;
}

.filters-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.filters-actions .btn {
  flex: 1;
  text-align: center;
}

.filters-reset {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.catalog-empty {
  color: var(--text-muted);
}

input, textarea, select {
  font: inherit;
  color: var(--text);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
}

input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

button {
  font: inherit;
}

/* Griglia veicoli */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.vehicle-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-subtle);
  box-shadow: var(--card-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  padding-bottom: 1rem;
}

.vehicle-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.12);
}

.vehicle-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  display: block;
  background: var(--bg-subtle);
}

.vehicle-card h2 {
  font-size: 1.05rem;
  margin: 0.85rem 1rem 0.25rem;
}

.vehicle-card p {
  margin: 0.25rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.vehicle-card-meta {
  font-size: 0.75rem !important;
  opacity: 0.85;
}

.price {
  font-weight: 700;
  color: var(--text) !important;
  font-size: 1.1rem !important;
}

.price-old {
  color: var(--text-muted) !important;
  font-weight: 400 !important;
  font-size: 0.9em !important;
  margin-right: 0.4rem;
}

.price-offer {
  color: var(--grafite) !important;
}

.offer-flag {
  display: inline-block;
  background: var(--ottone);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  margin: 0.85rem 1rem 0;
}

/* Dettaglio veicolo */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span {
  margin: 0 0.35rem;
}

.vehicle-title-row {
  margin-bottom: 1.5rem;
}

.vehicle-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.badge-category {
  background: rgba(168, 124, 79, 0.12);
  color: var(--ottone-press);
}

.badge-condition {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-neutral {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.vehicle-listing-code {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin: 0.35rem 0 0;
}

.vehicle-title-row h1 {
  margin: 0 0 0.35rem;
}

.vehicle-subtitle {
  color: var(--text-muted);
  margin: 0;
}

.vehicle-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .vehicle-layout {
    grid-template-columns: 1fr;
  }
}

.gallery {
  margin-bottom: 2rem;
}

#gallery-main {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: var(--bg-subtle);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
}

.gallery-thumb {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  line-height: 0;
  background: none;
}

.gallery-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--bg-subtle);
  display: block;
}

.gallery-thumb.is-active {
  border-color: var(--accent);
}

.section-title {
  font-size: 1.1rem;
  margin: 2rem 0 1rem;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.spec-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-subtle);
}

.spec-item svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
}

.spec-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.spec-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.spec-value {
  display: block;
  font-weight: 600;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Coppie etichetta/valore su righe: la griglia deve avere un numero di colonne
   multiplo di 2, altrimenti dt e dd si disallineano */
.specs-secondary {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 0 1.5rem;
  margin: 1rem 0 0;
}

.specs-secondary dt {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.specs-secondary dd {
  margin: 0;
  padding: 0.6rem 0;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.specs-note {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin: 0.25rem 0 0;
}

.footnote-ref {
  font-size: 0.75em;
  text-decoration: none;
  vertical-align: super;
}

.vehicle-description {
  color: var(--text);
  line-height: 1.7;
}

.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feature-chip {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.feature-chip-optional {
  background: rgba(168, 124, 79, 0.08);
  border-color: rgba(168, 124, 79, 0.3);
  color: var(--ottone-press);
}

.vehicle-side {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.price-box {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle);
  box-shadow: var(--card-shadow);
}

.price-box-old-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.price-box-old-row .price-old {
  color: var(--text-muted);
  font-size: 1rem;
}

.price-box-final {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
}

.price-box-savings {
  color: var(--ottone-press);
  font-weight: 600;
  font-size: 0.875rem;
  margin: 0.25rem 0 0;
}

.price-box-installment {
  margin: 0.4rem 0 0;
  font-weight: 600;
  font-size: 0.9375rem;
}

.price-box-installment span {
  display: block;
  font-weight: 400;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.price-box-highlights {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.price-box-highlights li {
  padding: 0.2rem 0;
  border-top: 1px solid var(--border);
}

.price-box-cta {
  display: block;
  text-align: center;
  width: 100%;
  margin-top: 1.25rem;
}

.dealer-box {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle);
}

.dealer-box h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.dealer-box p {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.dealer-box-link {
  font-size: 0.875rem;
  font-weight: 600;
}

.vehicle-contact {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  max-width: 600px;
}

/* Form */
.hp {
  position: absolute;
  left: -9999px;
}

.contact-form, .login-form {
  display: grid;
  gap: 0.75rem;
  max-width: 420px;
  margin-top: 1rem;
}

.contact-form label {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Pagina di login */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 260px);
  padding: 2rem 0;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-subtle);
  box-shadow: var(--card-shadow);
  text-align: center;
}

.login-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ottone-press);
  background: rgba(168, 124, 79, 0.12);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.login-card h1 {
  font-size: 1.4rem;
  margin: 0 0 0.5rem;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}

.login-form {
  max-width: none;
  text-align: left;
  margin-top: 0;
}

.login-form button {
  justify-self: stretch;
  text-align: center;
  margin-top: 0.5rem;
}

.login-register-hint {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.login-back {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
}

.login-back:hover {
  color: var(--accent);
}

.contact-form button, .login-form button {
  justify-self: start;
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 6px;
  padding: 0.65rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
}

.contact-form button:hover, .login-form button:hover {
  opacity: 0.9;
}

/* Tabelle backoffice */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-subtle);
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem;
  text-align: left;
}

th {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Backoffice */
.admin-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.admin-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
}

.admin-nav a:hover {
  color: var(--accent);
}

.admin-nav-role {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.admin-nav-role:hover {
  color: var(--accent);
}

.logout-form button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 1rem;
  cursor: pointer;
  color: var(--text-muted);
}

.logout-form button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.admin-header h1 {
  margin: 0;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--border);
  color: var(--text-muted);
}

.badge-available { background: #d1fadf; color: #05603a; }
.badge-draft { background: #fef0c7; color: #93370d; }
.badge-reserved { background: #d0e8ff; color: #1849a9; }
.badge-sold { background: #eaecf0; color: #344054; }
.badge-archived { background: #eaecf0; color: #667085; }
.badge-pending { background: #fef0c7; color: #93370d; }
.badge-approved { background: #d1fadf; color: #05603a; }
.badge-rejected { background: #fee4e2; color: #b42318; }
.badge-offer { background: var(--ottone); color: var(--avorio); margin-left: 0.35rem; }

.review-action-form {
  display: flex;
  gap: 0.5rem;
}

.vehicle-form, .upload-form {
  display: grid;
  gap: 1.5rem;
  max-width: 900px;
}

/* come per i filtri: label a blocco, così CO<sub>2</sub> resta su una riga */
.vehicle-form label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.vehicle-form label > input,
.vehicle-form label > select,
.vehicle-form label > textarea {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 0.35rem;
}

.vehicle-form .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vehicle-form .checkbox-label > input {
  display: inline-block;
  width: auto;
  margin-top: 0;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.vehicle-form .form-group {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin: 0;
}

.vehicle-form .form-group legend {
  padding: 0 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.vehicle-form .form-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.vehicle-form button, .upload-form button {
  justify-self: start;
}

.admin-images {
  margin-top: 2.5rem;
}

.admin-danger-zone {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  max-width: 720px;
}

.admin-danger-zone h2 {
  font-size: 1rem;
  margin: 1.5rem 0 0.75rem;
}

.admin-danger-zone h2:first-child {
  margin-top: 0;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.image-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--bg-subtle);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.btn-danger {
  background: none;
  border: 1px solid #d92d20;
  color: #d92d20;
  border-radius: 6px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-danger:hover {
  background: #d92d20;
  color: #fff;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  background: var(--bg);
  text-decoration: none;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.upload-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: none;
}

.lead-update-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.lead-update-form input[type="text"] {
  flex: 1;
  min-width: 140px;
}

/* Pagine statiche (Chi siamo / Contatti) */
.static-page {
  max-width: 900px;
  margin: 0 auto;
}

/* Pagine legali: privacy policy e simili */
.legal-page h2 {
  font-size: 1.15rem;
  margin: 2.25rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.legal-page h3 {
  font-size: 1rem;
  margin: 1.5rem 0 0.5rem;
}

.legal-page p,
.legal-page li {
  line-height: 1.65;
}

.legal-page ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0 1rem;
}

.legal-page li {
  margin-bottom: 0.4rem;
}

.legal-page-updated {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-top: -0.5rem;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.value-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-subtle);
}

.value-card h2 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}

.value-card p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.925rem;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  margin: 1.25rem 0;
}

.contact-details dt {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.contact-details dd {
  margin: 0;
  font-weight: 600;
}

.map-embed {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.map-embed iframe {
  width: 100%;
  height: 260px;
  border: 0;
  display: block;
}

@media (max-width: 720px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

/* Recensioni (home) */
.reviews {
  padding: 3.5rem 0 1rem;
  border-top: 1px solid var(--border);
}

.reviews h2 {
  font-size: 1.4rem;
  margin: 0 0 1.5rem;
  text-align: center;
}

.reviews-cta {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.reviews-empty {
  color: var(--text-muted);
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.review-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-subtle);
}

.review-stars {
  display: flex;
  gap: 0.15rem;
  margin-bottom: 0.75rem;
}

.star-icon {
  width: 18px;
  height: 18px;
  fill: none;
  color: var(--border);
}

.star-icon.star-filled {
  fill: var(--ottone);
  color: var(--ottone);
}

.review-comment {
  margin: 0 0 0.75rem;
  color: var(--text);
}

.review-author {
  margin: 0;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Modale recensione */
.review-modal {
  border: none;
  border-radius: 12px;
  padding: 2rem;
  max-width: 440px;
  width: calc(100% - 2rem);
  box-shadow: 0 20px 50px rgba(16, 24, 40, 0.25);
  color: var(--text);
  background: var(--bg);
}

.review-modal::backdrop {
  background: rgba(8, 12, 24, 0.55);
}

.review-modal h2 {
  margin: 0 0 1.25rem;
  font-size: 1.2rem;
}

.review-modal-close {
  display: flex;
  justify-content: flex-end;
  margin: -0.5rem -0.5rem 0.5rem 0;
}

.review-modal-close button {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
}

.review-modal-close button:hover {
  color: var(--text);
}

.review-form {
  display: grid;
  gap: 0.85rem;
}

.star-input {
  display: flex;
  gap: 0.25rem;
}

.star-input .star-btn {
  background: none;
  border: none;
  padding: 0.15rem;
  cursor: pointer;
  color: var(--border);
}

.star-input .star-btn svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
}

.star-input .star-btn.star-selected {
  color: var(--ottone);
}

.star-input .star-btn.star-selected svg {
  fill: var(--ottone);
}

.review-success {
  color: #05603a;
  font-weight: 600;
  margin-top: 0.75rem;
}

.review-error {
  color: #b42318;
  font-weight: 600;
  margin-top: 0.75rem;
}

/* Sidebar Auto in offerta (home) */
.offers-widget h2 {
  font-size: 1.1rem;
  margin: 0 0 1.25rem;
}

.offer-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.offer-card {
  display: flex;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-subtle);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.offer-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.offer-card img {
  width: 100px;
  height: 100%;
  min-height: 80px;
  object-fit: contain;
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.offer-card-body {
  padding: 0.6rem 0.85rem 0.6rem 0;
  min-width: 0;
}

.offer-card-body h3 {
  font-size: 0.9rem;
  margin: 0 0 0.35rem;
}

.offer-price {
  margin: 0;
  font-size: 0.85rem;
}

.offer-price s {
  color: var(--text-muted);
  margin-right: 0.4rem;
}

.offer-price-new {
  color: var(--ottone-press);
  font-weight: 700;
}

.offers-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Tabelle scrollabili (backoffice) */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}

/* Barra CTA fissa sul dettaglio veicolo: solo mobile */
.vehicle-cta-bar {
  display: none;
}

/* ==========================================================================
   Mobile e tablet
   ========================================================================== */

/* Tablet: sidebar offerte e layout a due colonne più stretti */
@media (max-width: 1100px) {
  .vehicle-layout {
    grid-template-columns: 1fr 280px;
    gap: 1.75rem;
  }

  .body-columns {
    padding: 0 1.5rem;
  }

  /* --- Filtri catalogo: sotto i 1100px si impilano sopra i risultati,
         quindi il pannello diventa richiudibile --- */
  .body-columns--filters {
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
  }

  .body-sidebar--filters {
    position: static;
    width: 100%;
    max-width: 1100px;
  }

  .filters-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-subtle);
    font-weight: 600;
    cursor: pointer;
  }

  .filters-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform 0.15s ease;
  }

  .filters-toggle-input:checked ~ .filters-toggle {
    border-color: var(--accent);
    color: var(--accent);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .filters-toggle-input:checked ~ .filters-toggle svg {
    transform: rotate(180deg);
    color: var(--accent);
  }

  .filters-form {
    display: none;
    border-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }

  /* col pannello aperto a tutta larghezza i campi vanno su più colonne */
  .filters-toggle-input:checked ~ .filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: start;
  }

  .filters-group + .filters-group {
    padding-top: 0;
    border-top: 0;
  }

  .filters-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  /* --- Header: menu a tendina --- */
  .site-header {
    grid-template-columns: 1fr auto auto;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }

  .site-logo {
    order: 1;
    min-width: 0;
  }

  /* 36px di altezza = ~180px di larghezza, il minimo previsto dalla brand guide
     per la versione orizzontale */
  .site-logo img {
    height: 36px;
  }

  .site-footer-logo img {
    height: 60px;
  }

  .site-header-actions {
    order: 2;
    gap: 0.5rem;
  }

  .site-header-aside {
    display: none;
  }

  .site-nav-toggle {
    order: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
  }

  .site-nav-toggle svg {
    width: 22px;
    height: 22px;
  }

  .nav-toggle-input:checked ~ .site-nav-toggle {
    border-color: var(--accent);
    color: var(--accent);
  }

  /* pannello a tendina: chiuso per default, aperto dalla checkbox */
  .site-header nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 1rem;
    justify-self: auto;
    flex-direction: column;
    gap: 0;
    min-width: 200px;
    margin-top: 0.4rem;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    box-shadow: var(--card-shadow);
    z-index: 200;
  }

  .nav-toggle-input:checked ~ nav {
    display: flex;
  }

  .site-header nav a {
    padding: 0.7rem 0.75rem;
    border-radius: 6px;
    color: var(--text);
  }

  .site-header nav a:active {
    background: var(--bg-subtle);
  }

  /* --- Spaziature generali --- */
  main {
    padding: 1.5rem 1rem;
  }

  h1 {
    font-size: 1.45rem;
    margin-bottom: 1.25rem;
  }

  .section-title {
    margin: 1.75rem 0 0.85rem;
  }

  .hero {
    margin-top: -1.5rem;
  }

  .body-columns {
    padding: 0 1rem;
    gap: 1.5rem;
  }

  .categories,
  .reviews {
    padding: 2.5rem 0 0.5rem;
  }

  .body-sidebar {
    padding-top: 2.5rem;
  }

  /* la barra dei filtri parte attaccata in alto, senza lo stacco della
     sidebar offerte (regola generica sopra, stessa specificità) */
  .body-sidebar--filters {
    padding-top: 0;
  }

  /* --- Campi: 16px evita lo zoom automatico su iOS, 44px è il target minimo --- */
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px;
    min-height: 44px;
  }

  input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }

  textarea {
    min-height: 96px;
  }

  .btn,
  button {
    min-height: 44px;
  }

  .filters-range {
    gap: 0.5rem;
  }

  /* --- Catalogo --- */
  .vehicle-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
  }

  /* --- Dettaglio veicolo --- */
  .vehicle-layout {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .vehicle-side {
    position: static;
    top: auto;
  }

  /* spazio in fondo alla pagina per non farla coprire dalla barra CTA fissa */
  body.has-cta-bar {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }

  .specs-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
  }

  .spec-item {
    padding: 0.7rem 0.8rem;
    gap: 0.6rem;
  }

  .specs-secondary {
    grid-template-columns: auto 1fr;
    gap: 0 1rem;
  }

  .gallery-thumbs {
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  }

  .vehicle-contact,
  .contact-form,
  .login-form {
    max-width: none;
  }

  .contact-form button,
  .login-form button {
    justify-self: stretch;
    text-align: center;
  }

  /* Barra CTA fissa: prezzo sempre visibile + azioni a portata di pollice */
  .vehicle-cta-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 150;
    padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(16, 24, 40, 0.1);
  }

  .vehicle-cta-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
  }

  .vehicle-cta-price {
    font-weight: 700;
    font-size: 1.05rem;
    white-space: nowrap;
  }

  .vehicle-cta-note {
    font-size: 0.7rem;
    color: var(--text-muted);
  }

  .vehicle-cta-bar .btn {
    padding: 0.6rem 1rem;
    white-space: nowrap;
  }

  .vehicle-cta-call {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
  }

  .vehicle-cta-call svg {
    width: 20px;
    height: 20px;
  }

  /* --- Footer e note legali --- */
  .site-footer {
    padding: 1.5rem 1rem;
    margin-top: 2rem;
  }

  .legal-disclaimer {
    padding: 1rem 1rem 1.5rem;
  }

  .legal-disclaimer p {
    text-align: left;   /* il testo giustificato su schermo stretto crea "fiumi" bianchi */
  }

  /* --- Backoffice --- */
  .admin-nav {
    gap: 1rem;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.85rem;
  }

  .admin-nav-role {
    margin-left: 0;
  }

  .admin-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .table-wrap table {
    min-width: 640px;
  }

  .vehicle-form .form-group {
    padding: 1rem 0.85rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .vehicle-form button,
  .upload-form button {
    justify-self: stretch;
  }

  .image-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  /* --- Pagine legali --- */
  .legal-page h2 {
    font-size: 1.05rem;
  }
}

@media (max-width: 520px) {
  .vehicle-grid {
    grid-template-columns: 1fr;
  }

  .specs-grid {
    grid-template-columns: 1fr 1fr;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .value-grid,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 1.75rem 1.25rem;
  }

  .review-modal {
    padding: 1.5rem 1.25rem;
  }
}

/* Comodità di lettura su schermi ad alta densità in modalità scura di sistema:
   il portale è a tema chiaro, forziamo lo schema per evitare inversioni del browser */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light;
  }
}
