:root {
  --ink: #172026;
  --muted: #64717a;
  --line: #dfe5e8;
  --paper: #f6f7f5;
  --white: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f9fbfb;
  --field: #fbfcfc;
  --field-border: #cfd8dd;
  --red: #c92127;
  --red-dark: #981b20;
  --teal: #0f766e;
  --blue: #245d8f;
  --shadow: 0 18px 50px rgba(23, 32, 38, 0.14);
  --header-bg: rgba(255, 255, 255, 0.9);
  --header-border: rgba(223, 229, 232, 0.9);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: #f4f7f7;
  --muted: #aebcc4;
  --line: #31414a;
  --paper: #101619;
  --white: #151d21;
  --panel: #172126;
  --panel-soft: #202c32;
  --field: #11191d;
  --field-border: #40515b;
  --red: #f0444b;
  --red-dark: #c92127;
  --teal: #37c7b7;
  --blue: #78b8f2;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
  --header-bg: rgba(16, 22, 25, 0.88);
  --header-border: rgba(49, 65, 74, 0.9);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, Arial, sans-serif;
  transition: background 180ms ease, color 180ms ease;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  display: block;
  width: auto;
  height: 48px;
  object-fit: contain;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 28px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
}

.main-nav a,
.footer-links a {
  transition: color 180ms ease;
}

.main-nav a:hover,
.footer-links a:hover {
  color: var(--red);
}

.header-action,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
}

.header-action {
  color: #ffffff;
  background: var(--ink);
}

:root[data-theme="dark"] .header-action {
  color: #101619;
  background: #ffffff;
}

.header-controls,
.admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(23, 32, 38, 0.08);
}

.button.primary {
  color: #ffffff;
  background: var(--red);
}

.button.secondary {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(23, 32, 38, 0.34);
}

.hero {
  position: relative;
  min-height: 88vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 130px clamp(18px, 6vw, 80px) 86px;
}

.hero-media,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(10, 15, 18, 0.76) 0%, rgba(10, 15, 18, 0.42) 42%, rgba(10, 15, 18, 0.08) 100%),
    linear-gradient(0deg, rgba(10, 15, 18, 0.54) 0%, rgba(10, 15, 18, 0.04) 38%);
}

.hero-content {
  position: relative;
  width: min(720px, 100%);
  color: var(--white);
}

.hero-logo {
  display: block;
  width: min(520px, 88vw);
  height: auto;
  margin-bottom: 22px;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.38));
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #ffffff;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(3.1rem, 9vw, 7rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 2vw, 1.28rem);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.search-band {
  position: relative;
  z-index: 2;
  margin-top: -40px;
  padding: 0 clamp(18px, 4vw, 56px);
}

.search-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) 48px;
  gap: 12px;
  align-items: end;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 8px;
  color: #33414a;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--field-border);
  border-radius: 6px;
  font: inherit;
  text-transform: none;
}

textarea {
  resize: vertical;
}

select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.icon-button {
  width: 48px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: var(--panel-soft);
  border: 1px solid var(--field-border);
  border-radius: 6px;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
}

.section,
.split-section {
  padding: 88px clamp(18px, 4vw, 56px);
}

.section-heading {
  max-width: 1180px;
  margin: 0 auto 28px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.result-count,
.muted {
  color: var(--muted);
  line-height: 1.6;
}

.vehicle-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.vehicle-card {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 32, 38, 0.08);
}

.vehicle-image {
  position: relative;
  min-height: 210px;
  background-image: url("assets/hero-im4-motion.png");
  background-size: cover;
  background-position: center;
}

.vehicle-card:nth-child(2n) .vehicle-image {
  background-position: right center;
}

.vehicle-card:nth-child(3n) .vehicle-image {
  background-position: left center;
}

.badge {
  position: absolute;
  left: 14px;
  top: 14px;
  padding: 7px 10px;
  color: #ffffff;
  background: var(--ink);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.vehicle-body {
  padding: 18px;
}

.vehicle-body h3 {
  margin: 0 0 8px;
  font-size: 1.16rem;
}

.vehicle-meta,
.vehicle-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vehicle-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.vehicle-price {
  margin: 16px 0;
  font-size: 1.6rem;
  font-weight: 800;
}

.vehicle-tags span {
  padding: 7px 9px;
  background: var(--panel-soft);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.card-action {
  width: 100%;
  margin-top: 18px;
  color: var(--red-dark);
  background: rgba(201, 33, 39, 0.1);
  border: 1px solid rgba(201, 33, 39, 0.22);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 34px;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed #bcc8ce;
  border-radius: 8px;
  text-align: center;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 48px;
  align-items: center;
  background: var(--panel);
}

.feature-block {
  max-width: 680px;
}

.feature-block p,
.check-list {
  color: var(--muted);
  line-height: 1.7;
}

.check-list {
  padding-left: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stats-grid div {
  min-height: 142px;
  padding: 22px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.stats-grid strong {
  font-size: 2rem;
  color: var(--red);
}

.stats-grid span {
  color: var(--muted);
  line-height: 1.4;
}

.form-section {
  background: var(--panel-soft);
}

.publish-form {
  max-width: 820px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.publish-form label:has(textarea),
.publish-form button,
.form-status {
  grid-column: 1 / -1;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--teal);
  font-weight: 700;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(18px, 4vw, 56px);
  color: #ffffff;
  background: var(--ink);
}

.site-footer p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.68);
}

.footer-logo {
  display: block;
  width: 210px;
  height: auto;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.25));
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.admin-page {
  min-height: 100vh;
  background: var(--paper);
}

.admin-shell {
  min-height: 100vh;
}

.admin-login {
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: 80px 18px 30px;
  position: relative;
}

.login-topbar {
  position: absolute;
  top: 24px;
  left: 0;
  right: 0;
  padding: 0 clamp(18px, 4vw, 56px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.admin-login h1 {
  margin-bottom: 0;
  font-size: clamp(2.2rem, 5vw, 4.5rem);
  text-align: center;
}

.admin-logo {
  width: min(430px, 86vw);
  filter: drop-shadow(0 8px 18px rgba(23, 32, 38, 0.12));
}

.admin-card {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(23, 32, 38, 0.08);
}

.admin-login .admin-card {
  max-width: 430px;
  display: grid;
  gap: 16px;
  padding: 22px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.google-button {
  gap: 10px;
  color: var(--ink);
  background: var(--panel);
  border-color: var(--field-border);
}

.google-button span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--white);
  background: #4285f4;
  border-radius: 999px;
  font-weight: 800;
}

.admin-panel {
  padding: 24px clamp(18px, 4vw, 56px) 56px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.admin-public-link {
  color: var(--ink);
  border-color: var(--field-border);
  background: var(--panel);
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.admin-summary div {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-summary span {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.admin-summary strong {
  font-size: 2.3rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.42fr) minmax(0, 0.58fr);
  gap: 18px;
  align-items: start;
}

.stock-form,
.stock-list {
  padding: 20px;
}

.stock-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stock-form-brand {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 12px 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stock-form-brand img {
  width: min(240px, 58vw);
  height: auto;
  filter: drop-shadow(0 6px 12px rgba(23, 32, 38, 0.12));
}

.stock-form-brand span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
  text-transform: uppercase;
}

.admin-section-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-section-heading h2 {
  font-size: 1.55rem;
}

.wide-field,
.availability-field,
.stock-form .button,
.stock-form .form-status {
  grid-column: 1 / -1;
}

.availability-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  text-transform: none;
}

.availability-field input {
  width: 18px;
  min-height: 18px;
}

.photo-manager {
  display: grid;
  gap: 10px;
}

.photo-preview {
  min-height: 96px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px dashed #c6d2d7;
  border-radius: 8px;
}

.photo-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  text-transform: none;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: var(--panel-soft);
}

.photo-thumb img,
.stock-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  color: #ffffff;
  background: rgba(23, 32, 38, 0.82);
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.stock-thumb {
  display: block;
  width: 74px;
  height: 54px;
  margin: 0 0 8px;
  border-radius: 6px;
}

.stock-thumb.is-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

td span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.status-pill {
  display: inline-flex;
  margin-top: 0;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-pill.is-on {
  color: #075f55;
  background: #dff5f1;
}

.status-pill.is-off {
  color: #7a2530;
  background: #ffe4e6;
}

:root[data-theme="dark"] .status-pill.is-off {
  color: #ffc2ca;
  background: rgba(240, 68, 75, 0.18);
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-actions button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--panel-soft);
  border: 1px solid var(--field-border);
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
}

.leads-panel {
  margin-top: 18px;
  padding: 20px;
}

.lead-counter {
  color: var(--muted);
  font-weight: 800;
}

.lead-list {
  display: grid;
  gap: 12px;
}

.lead-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.lead-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lead-item p {
  margin: 10px 0;
  color: var(--ink);
  line-height: 1.5;
}

.lead-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.lead-meta span {
  display: inline-flex;
  margin-top: 0;
}

.status-pill.is-new {
  color: #7a5312;
  background: #fff2cc;
}

:root[data-theme="dark"] .status-pill.is-new {
  color: #ffe29b;
  background: rgba(245, 158, 11, 0.18);
}

.is-hidden {
  display: none;
}

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    display: none;
  }

  .search-panel,
  .vehicle-grid,
  .split-section,
  .admin-summary,
  .admin-layout,
  .publish-form {
    grid-template-columns: 1fr;
  }

  .icon-button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .site-header {
    position: absolute;
    padding: 14px 16px;
  }

  .header-action {
    display: none;
  }

  .hero {
    min-height: 84vh;
    padding: 112px 18px 76px;
  }

  .hero-copy {
    font-size: 1rem;
  }

  .section,
  .split-section {
    padding: 62px 18px;
  }

  .section-heading,
  .site-footer,
  .admin-topbar,
  .admin-section-heading,
  .stock-form-brand,
  .lead-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .stock-form-brand span {
    text-align: left;
  }

  .lead-item {
    grid-template-columns: 1fr;
  }

  .stock-form {
    grid-template-columns: 1fr;
  }

  .search-band {
    margin-top: -30px;
  }
}
