:root {
  --bg: #0f172a;
  --panel: #111827;
  --card: #0b1220;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #22d3ee;
  --border: #1f2937;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top, #1e293b, #0f172a 40%);
  color: var(--text);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #1877f2;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 22px;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
}

.brand-title {
  font-size: 18px;
  font-weight: 600;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

button.nav-link {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
  line-height: 1;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-upgrade {
  position: relative;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  display: inline;
}

.nav-upgrade:hover {
  filter: brightness(1.05);
}

 .upgrade-text {
  color: #f7d36a;
  font-weight: 700;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
  .upgrade-text {
    background: linear-gradient(120deg, #f7d36a, #ffffff, #f2b93b, #f7d36a);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: shimmer 2.6s linear infinite;
  }
}

@keyframes shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}


.content {
  flex: 1;
  padding: 32px 24px 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.results-page .content {
  align-items: flex-start;
  flex-direction: column;
  gap: 12px;
  padding-top: 18px;
  justify-content: flex-start;
}

.hero {
  display: grid;
  gap: 48px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: center;
  justify-items: stretch;
  width: 100%;
  max-width: 1500px;
  padding: 24px 0;
}

.hero h1 {
  font-size: 42px;
  margin: 0 0 12px;
}

.typewriter {
  min-height: 52px;
}

.typewriter-text {
  display: inline-block;
  padding-right: 4px;
}

.typewriter.typing .typewriter-text {
  border-right: 2px solid var(--accent);
  animation: caret 0.8s steps(1) infinite;
}

@keyframes caret {
  50% {
    border-color: transparent;
  }
}

.hero p {
  color: var(--muted);
  font-size: 16px;
  margin: 0;
}

.hero-subtext {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.hero-subtext.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.card {
  background: var(--panel);
  border-radius: 20px;
  padding: 32px 32px 28px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 980px;
  margin: 0;
}

.quota-locked {
  opacity: 0.6;
}

.quota-locked input,
.quota-locked select {
  cursor: not-allowed;
}

.upgrade-cta,
.primary.upgrade-cta {
  background: linear-gradient(135deg, #f7d36a, #f2b93b);
  color: #1f1300;
  font-weight: 700;
  text-align: center;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
}

.quota-banner {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
}

.quota-sep {
  height: 1px;
  background: var(--border);
  margin: 16px 0 8px;
}

.form {
  display: grid;
  gap: 24px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

input, select {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.car-only {
  display: none;
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: #0f172a;
  font-weight: 600;
  padding: 14px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
}

.secondary {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  background: transparent;
  cursor: pointer;
}

button.secondary {
  background: transparent;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.suggestions {
  position: relative;
  display: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 220px;
  overflow: auto;
  margin-top: 6px;
}

.suggestion-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}

.suggestion-item:hover {
  background: rgba(148, 163, 184, 0.15);
}

.results-hero {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.18), rgba(15, 23, 42, 0.7));
  margin-bottom: 6px;
}

.results-hero-text h2 {
  margin: 4px 0 2px;
  font-size: 24px;
}

.results-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.results-subtitle {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}

.results-hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.results-hero .secondary,
.results-hero .primary {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.results-hero #saveButton {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0f172a;
  border: none;
  font-weight: 700;
}

.results-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.offer-card {
  background: rgba(12, 18, 34, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 22px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 190px 1fr;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.offer-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 18px 32px rgba(2, 6, 23, 0.5);
}

.offer-media {
  position: relative;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.35), rgba(15, 23, 42, 0.2));
  display: grid;
  place-items: center;
  overflow: hidden;
}

.offer-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.offer-placeholder {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
}

.offer-price {
  position: absolute;
  right: 14px;
  bottom: 14px;
  background: rgba(2, 6, 23, 0.88);
  border: 1px solid rgba(34, 197, 94, 0.6);
  padding: 8px 12px;
  border-radius: 14px;
  display: grid;
  gap: 2px;
  min-width: 88px;
}

.offer-price-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(148, 163, 184, 0.8);
}

.offer-price-value {
  font-size: 16px;
  font-weight: 700;
  color: #22c55e;
}

.offer-body {
  padding: 16px 18px 18px;
  display: grid;
  gap: 14px;
}

.offer-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.offer-meta {
  display: grid;
  gap: 8px;
}

.offer-meta-item {
  display: grid;
  gap: 4px;
}

.offer-meta-label {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.offer-meta-value {
  font-size: 13px;
  color: var(--text);
}


.result-tile {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 150px 1fr;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.result-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.35);
}

.result-media {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(34, 211, 238, 0.08));
  display: grid;
  place-items: center;
  overflow: hidden;
}

.result-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.result-body {
  padding: 16px 18px 20px;
  display: grid;
  gap: 12px;
}

.result-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.result-title-row h3 {
  margin: 0;
  font-size: 16px;
}

.price-pill {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.result-details {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.result-actions {
  display: flex;
  justify-content: flex-start;
}

.result-actions .secondary,
.result-actions .primary {
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
}

.result-actions .secondary:hover,
.result-actions .primary:hover {
  background: rgba(56, 189, 248, 0.2);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.modal.show {
  display: flex;
  animation: modalFade 0.2s ease-out;
}

.modal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  animation: modalPop 0.2s ease-out;
}

.upgrade-lock {
  width: 100%;
  display: grid;
  place-items: center;
  margin: 10px 0 20px;
}

.upgrade-lock-card {
  width: 100%;
  max-width: 520px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 18px;
  padding: 24px;
  display: grid;
  gap: 12px;
  text-align: left;
  box-shadow: 0 18px 30px rgba(2, 6, 23, 0.45);
}

@keyframes modalFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalPop {
  from {
    transform: translateY(6px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.upgrade-card {
  max-width: 480px;
  display: grid;
  gap: 12px;
}

.upgrade-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}

.upgrade-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 13px;
  display: grid;
  gap: 6px;
}

.upgrade-foot {
  color: var(--muted);
  font-size: 11px;
  margin: 0;
}

.modal-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}


.result-card {
  background: var(--panel);
  border-radius: 16px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.result-card h3 {
  margin: 0 0 6px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.empty, .alert {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 12px;
}

.alert {
  color: #fca5a5;
}

.auth-card .alert {
  margin: 0 0 18px;
}

.muted {
  color: var(--muted);
  margin: 8px 0 0;
}

.auth-card .muted {
  margin-bottom: 16px;
}

.auth {
  width: 100%;
  display: flex;
  justify-content: center;
}

.auth-card,
.account-card {
  width: 100%;
  max-width: 640px;
}

.account {
  width: 100%;
  display: grid;
  gap: 24px;
  justify-items: center;
}

.watchlist-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.saved-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.saved-item {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
}

.watchlist-card {
  flex-direction: column;
  gap: 8px;
}

.watchlist-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.watchlist-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.watchlist-title-row h4 {
  margin: 0;
}

.watchlist-badge {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.5);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.watchlist-subtitle {
  margin: 0;
}

.watchlist-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  margin-top: 12px;
}

.watchlist-details {
  color: var(--muted);
  margin-top: 2px;
}

.watchlist-details summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  list-style: none;
}

.watchlist-details summary::-webkit-details-marker {
  display: none;
}

.watchlist-details summary::after {
  content: "▾";
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.watchlist-details[open] summary::after {
  transform: rotate(180deg);
}

.watchlist-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.watchlist-filters span {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.watchlist-items {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.watchlist-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(15, 23, 42, 0.75);
}

.watchlist-new {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.08);
}

.watchlist-item img,
.watchlist-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.watchlist-thumb {
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-weight: 700;
}

.watchlist-title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 18px 48px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 720px) {
  .topbar, .content, .footer {
    padding: 20px;
  }

  .content {
    align-items: stretch;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .result-card {
    flex-direction: column;
    align-items: flex-start;
  }
}
