:root {
  --bg: #edf1f4;
  --surface: #ffffff;
  --surface-soft: #f5f7f9;
  --ink: #101829;
  --ink-soft: #5f6d85;
  --line: #d8e0eb;
  --accent: #0f4c81;
  --accent-2: #de6f2b;
  --accent-3: #0f8b6f;
  --shadow: 0 22px 48px rgba(16, 24, 41, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: "Sora", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 10%, rgba(15, 76, 129, 0.19), transparent 36%),
    radial-gradient(circle at 5% 30%, rgba(222, 111, 43, 0.16), transparent 32%),
    linear-gradient(140deg, #eef2f6 0%, #ecf3ef 50%, #f2efea 100%);
}

body.no-scroll {
  overflow: hidden;
}

.ambient-shape {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  filter: blur(50px);
  opacity: 0.4;
}

.shape-a {
  width: 330px;
  height: 330px;
  top: -80px;
  left: -90px;
  background: #0f4c81;
}

.shape-b {
  width: 360px;
  height: 360px;
  right: -120px;
  bottom: -110px;
  background: #de6f2b;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1280px, 94%);
  margin: 22px auto 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  padding: 12px 18px;
  box-shadow: 0 10px 28px rgba(13, 35, 62, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.2), transparent 45%),
    linear-gradient(145deg, #0f4c81, #0e364f);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.brand-text {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  line-height: 1.15;
}

.brand-text strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.3px;
}

.brand-text small {
  font-size: 0.68rem;
  color: var(--ink-soft);
}

.top-nav {
  display: inline-flex;
  gap: 18px;
}

.top-nav a {
  color: #293a56;
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 600;
}

.top-nav a:hover {
  color: #0f4c81;
}

.top-cta {
  display: inline-flex;
  gap: 10px;
}

.btn {
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 10px 18px;
}

.btn-main {
  background: linear-gradient(130deg, #0f4c81, #0d395d);
  color: #fff;
}

.btn-ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: #1f2f47;
}

.hero {
  margin-top: 16px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  background:
    linear-gradient(to top, rgba(8, 15, 30, 0.7), rgba(8, 15, 30, 0.2)),
    url("https://images.unsplash.com/photo-1494976388531-d1058494cdd8?auto=format&fit=crop&w=1600&q=80")
      center / cover no-repeat;
  box-shadow: var(--shadow);
}

.hero-content {
  color: #fff;
  width: min(680px, 100%);
  padding: 34px;
  animation: rise 0.65s ease-out both;
}

.hero-content h1 {
  margin: 8px 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.75rem, 2.8vw, 2.4rem);
  line-height: 1.1;
}

.hero-content p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
  line-height: 1.6;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.69rem;
  font-weight: 700;
  color: #7690b8;
}

.quick-search {
  margin-top: -24px;
  position: relative;
  z-index: 2;
}

.quick-search-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr auto;
  gap: 10px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 16px 32px rgba(13, 35, 62, 0.15);
}

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.76rem;
  color: #5a6780;
  font-weight: 600;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.84rem;
  color: #1f2f47;
  background: #fff;
}

input:focus,
select:focus {
  outline: none;
  border-color: #3f7caf;
  box-shadow: 0 0 0 3px rgba(63, 124, 175, 0.18);
}

.quick-search .btn-main {
  align-self: end;
  padding: 12px 20px;
}

.market-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: 280px 1fr;
  margin-top: 18px;
}

.filters,
.results {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 28px rgba(13, 35, 62, 0.1);
}

.filters {
  padding: 18px;
  position: sticky;
  top: 16px;
  height: fit-content;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-family: "Space Grotesk", sans-serif;
}

.text-btn {
  border: 0;
  padding: 0;
  cursor: pointer;
  background: none;
  color: #0f4c81;
  font-weight: 700;
}

.full-field {
  margin-bottom: 14px;
}

.filter-group {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.filter-group h3 {
  margin: 0 0 9px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #66748f;
}

.filter-group label {
  flex-direction: row;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: #21324d;
}

.filter-group input[type="checkbox"] {
  margin: 0;
}

.results {
  padding: 18px;
}

.results-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.results-head h2 {
  margin: 6px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
}

.sort {
  min-width: 220px;
}

.category-row {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: #2e405c;
  border-radius: 999px;
  padding: 8px 14px;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.78rem;
}

.chip.active {
  border-color: #0f4c81;
  color: #fff;
  background: #0f4c81;
}

.featured-strip {
  margin-top: 16px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.featured-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  min-height: 140px;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  color: #fff;
  background: #21324d;
}

.featured-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.featured-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9, 16, 30, 0.75), transparent);
  z-index: 1;
}

.featured-card > div {
  position: relative;
  z-index: 2;
}

.featured-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.featured-card p {
  margin: 0;
  font-size: 0.78rem;
  opacity: 0.92;
}

.listing-grid {
  margin-top: 16px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.car-card {
  background: #fff;
  border: 1px solid #e1e8f0;
  border-radius: 16px;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  animation: fadeUp 0.42s ease both;
}

.car-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 26px rgba(12, 31, 55, 0.13);
}

.car-photo {
  position: relative;
  height: 162px;
}

.car-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  border-radius: 999px;
  background: rgba(15, 76, 129, 0.9);
  color: #fff;
  font-size: 0.67rem;
  font-weight: 700;
  padding: 5px 10px;
}

.car-body {
  padding: 12px;
}

.car-title {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

.car-price {
  margin: 6px 0 0;
  color: #0f4c81;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.car-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-pill {
  border-radius: 999px;
  background: var(--surface-soft);
  color: #33445f;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
}

.car-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.location {
  font-size: 0.76rem;
  color: #64728a;
}

.link-btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: #0f4c81;
  color: #fff;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
}

.empty-state {
  margin-top: 18px;
  background: #f8fafc;
  border: 1px dashed #bfd0e3;
  border-radius: 14px;
  padding: 22px;
  text-align: center;
}

.empty-state h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.empty-state p {
  margin: 8px 0 0;
  color: #5f6d85;
  font-size: 0.88rem;
}

.info-section {
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 28px rgba(13, 35, 62, 0.1);
  padding: 20px;
}

.section-head h2 {
  margin: 6px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
}

.cta-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.cta-section h2 {
  margin: 6px 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.4rem;
}

.cta-section p {
  margin: 0;
  color: #5f6d85;
  max-width: 650px;
}

.credit-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.credit-grid .btn-main {
  align-self: end;
  padding-block: 11px;
}

.credit-result {
  grid-column: span 3;
  border-radius: 12px;
  border: 1px dashed #b8cbe1;
  background: #f7fbff;
  color: #28466a;
  padding: 12px;
  font-size: 0.88rem;
  font-weight: 600;
}

.article-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.article-card {
  border: 1px solid #dee6f1;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

.article-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.article-card p {
  margin: 8px 0 12px;
  color: #5f6d85;
  font-size: 0.85rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 15, 30, 0.62);
}

.modal-dialog {
  width: min(460px, 100%);
  background: #fff;
  border-radius: 16px;
  border: 1px solid #d7e1ee;
  box-shadow: 0 22px 46px rgba(8, 15, 30, 0.32);
  padding: 16px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.modal-head h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
}

.icon-close {
  width: 32px;
  height: 32px;
  border: 1px solid #d6dfeb;
  border-radius: 10px;
  background: #fff;
  font-size: 0.95rem;
  cursor: pointer;
}

.modal-form {
  display: grid;
  gap: 10px;
}

.modal-form .btn-main {
  margin-top: 4px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  background: #0f4c81;
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 12px 28px rgba(8, 15, 30, 0.22);
  font-size: 0.84rem;
  font-weight: 700;
}

.hidden {
  display: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .top-nav {
    display: none;
  }

  .quick-search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-search .btn-main {
    grid-column: span 2;
  }

  .market-layout {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }

  .credit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .credit-result {
    grid-column: span 2;
  }

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

@media (max-width: 700px) {
  .page-shell {
    width: min(94%, 540px);
    margin-top: 12px;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .top-cta {
    width: 100%;
  }

  .top-cta .btn {
    flex: 1;
  }

  .hero {
    min-height: 280px;
  }

  .hero-content {
    padding: 22px;
  }

  .quick-search-grid {
    grid-template-columns: 1fr;
  }

  .quick-search .btn-main {
    grid-column: auto;
  }

  .results-head {
    flex-direction: column;
    align-items: stretch;
  }

  .sort {
    min-width: 0;
  }

  .cta-section {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .credit-result {
    grid-column: auto;
  }
}
