/* ===================================================
   NEXTIE — GLOBAL THEME (CLEAN BASE)
=================================================== */

:root {
  --bg: #050713;
  --bg-elevated: #0b1020;
  --text: #e7ecf5;
  --muted: #9ba3b5;

  --accent: #00c2ff;
  --accent-soft: rgba(0, 194, 255, 0.18);
  --accent-glow:
    0 0 20px rgba(0, 194, 255, 0.35),
    0 0 40px rgba(0, 194, 255, 0.18);

  --border: rgba(255,255,255,0.08);

  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 20px;

  --fast: 0.15s ease;
  --med: 0.25s ease;
}

/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ===============================
   SAFE CONTAINER SYSTEM (FIX)
================================ */

/* Full-width by default */
body > header,
body > nav,
body > main,
body > section,
body > footer {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Controlled content container */
.container,
.dp-container,
.content {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 28px;
  padding-right: 28px;
}

/* Hero / first section spacing */
main > section:first-child,
body > main:first-of-type {
  padding-top: 80px;
}

/* ===================================================
   HEADER
=================================================== */

.dp-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5,7,19,0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-m);
  box-shadow: var(--accent-glow);
}

/* ===================================================
   BUTTONS
=================================================== */

.btn {
  padding: 10px 18px;
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  font-weight: 600;
  box-shadow: var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

/* ===================================================
   PAGE LAYOUT
=================================================== */

/* Vertical rhythm */
section {
  margin-top: 64px;
}

/* Hero-style first section spacing */
body > section:first-of-type,
body > main:first-of-type {
  margin-top: 80px;
}

/* Header links alignment */
header, nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

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

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

.dp-container {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 28px;
}

.dp-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 6px;
}

.dp-subtitle {
  color: var(--muted);
  margin-bottom: 28px;
}

/* ===================================================
   TILE GRID (CLICK-SAFE)
=================================================== */

#tilesContainer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
  position: relative;
  z-index: 1;
}

.dealer-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 22px;
  cursor: pointer;
  transition: transform var(--fast), border-color var(--fast);
  position: relative;
}

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

.dealer-tile * {
  pointer-events: none; /* critical: whole tile clickable */
}

.dealer-tile::before,
.dealer-tile::after {
  content: none !important;
}
/* ===================================================
   DEALER MODAL — HARD CENTERED (AUTHORITATIVE)
=================================================== */

/* Backdrop */
.dealer-modal-backdrop {
  position: fixed;
  inset: 0;

  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);

  z-index: 9998;
}

/* Modal wrapper — CENTERING ENGINE */
.dealer-modal {
  position: fixed;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 9999;
}

/* Hidden state */
.dealer-modal.hidden,
.dealer-modal-backdrop.hidden {
  display: none;
}

/* Modal card */
.dealer-modal-inner {
  width: 100%;
  max-width: 820px;

  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);

  padding: 26px;
  box-shadow: var(--accent-glow);

  animation: modalIn 0.25s ease;
}

/* Header */
.dealer-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.dealer-modal-header h3 {
  font-size: 22px;
  font-weight: 600;
}

/* Close button */
.dealer-modal-header button {
  color: #ff5f5f;
  border-color: rgba(255, 95, 95, 0.4);
}

.dealer-modal-header button:hover {
  background: rgba(255, 95, 95, 0.1);
}

/* Summary */
.dealer-modal-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}

/* Quote inputs */
.dealer-modal-quote {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

/* Actions */
.modal-actions {
  display: flex;
  gap: 16px;
}

.modal-actions .btn-primary {
  flex: 1;
}

/* Animation */
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Mobile */
@media (max-width: 640px) {
  .dealer-modal-inner {
    margin: 12px;
    padding: 18px;
  }

  .dealer-modal-summary {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column;
  }
}
/* ===================================================
   MODAL OVERRIDE — FORCE CENTER (WINS ALL CSS)
=================================================== */

#leadModal {
  position: fixed !important;
  inset: 0 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 100vw !important;
  height: 100vh !important;

  margin: 0 !important;
  padding: 0 !important;

  z-index: 9999 !important;
}

#leadModal.hidden {
  display: none !important;
}

#leadModal .dealer-modal-inner {
  position: relative !important;

  top: auto !important;
  left: auto !important;
  transform: none !important;

  width: 100%;
  max-width: 820px;

  margin: 0 !important;
}

.dealer-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9998 !important;
}