/* EVAds.co.uk — base styles. Minimal, premium, high-legibility. */

:root {
  --ev-green: #00c389;
  --ev-green-dark: #00a271;
  --ink: #0f172a;
  --ink-soft: #475569;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --danger: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
  --max: 1180px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

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

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Navbar ─────────────────────────────────────────── */
.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
}
.brand .bolt { color: var(--ev-green); }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14.5px; font-weight: 500; }
.nav-links a { color: var(--ink-soft); }
.nav-links a:hover { color: var(--ink); }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.15s ease;
  line-height: 1.2;
}
.btn-primary { background: var(--ev-green); color: #fff; }
.btn-primary:hover { background: var(--ev-green-dark); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ── Hero ───────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0b1220 0%, #0f2f28 100%);
  color: #fff;
  padding: 64px 0 48px;
}
.hero h1 { font-size: 38px; margin: 0 0 8px; letter-spacing: -0.03em; }
.hero p { color: #cbd5e1; font-size: 17px; margin: 0 0 28px; }

.search-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 12px;
  color: var(--ink);
}
@media (max-width: 900px) {
  .search-card { grid-template-columns: 1fr 1fr; }
}

/* ── Forms ──────────────────────────────────────────── */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ev-green); outline-offset: 1px; }
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 700px) {
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
}
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 20px; }
legend { font-weight: 700; padding: 0 8px; font-size: 15px; }
.hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }

/* ── Cards / grid ───────────────────────────────────── */
.section { padding: 48px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; }
.section-head h2 { font-size: 22px; margin: 0; letter-spacing: -0.02em; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }

.listing-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.listing-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,23,42,0.10); }
.listing-card .thumb { aspect-ratio: 4/3; background: #eef2f6 url('/img/placeholder-car.svg') center/cover no-repeat; }
.listing-card .body { padding: 14px 16px; }
.listing-card .price { font-weight: 800; font-size: 18px; }
.listing-card .title { font-weight: 600; font-size: 14.5px; margin: 2px 0 8px; color: var(--ink-soft); }
.listing-card .meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.badge {
  background: #ecfdf5;
  color: var(--ev-green-dark);
  border-radius: 6px;
  padding: 3px 8px;
  font-weight: 600;
  font-size: 12px;
}
.badge-muted { background: #f1f5f9; color: var(--ink-soft); }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: var(--danger); }
.featured-flag {
  position: absolute; margin: 10px; background: #0f172a; color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 5px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.thumb-wrap { position: relative; }

/* ── Alerts / flash ─────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; font-weight: 500; }
.alert-success { background: #ecfdf5; color: var(--ev-green-dark); border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Tables ─────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-soft); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }

/* ── Detail page ────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.gallery-main { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/10; background: #eef2f6 url('/img/placeholder-car.svg') center/cover no-repeat; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.gallery-thumbs img { width: 76px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; }
.spec-table td:first-child { color: var(--ink-soft); width: 45%; }
.sticky-panel { position: sticky; top: 84px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; }
.pagination a, .pagination span {
  padding: 8px 13px; border-radius: 7px; border: 1px solid var(--line); font-size: 14px; font-weight: 600;
}
.pagination .active { background: var(--ink); color: #fff; border-color: var(--ink); }

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

.footer { border-top: 1px solid var(--line); padding: 32px 0; margin-top: 60px; color: var(--ink-soft); font-size: 13.5px; }

.stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 28px; }
@media (max-width: 900px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat-card .num { font-size: 26px; font-weight: 800; }
.stat-card .label { color: var(--ink-soft); font-size: 13px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs a { padding: 10px 4px; margin-right: 20px; font-weight: 600; color: var(--ink-soft); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--ink); border-color: var(--ev-green); }

.auth-card { max-width: 420px; margin: 60px auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 22px; margin-top: 0; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
