:root {
  color-scheme: light;
  --ink: #18201b;
  --muted: #5c665f;
  --line: #d8dfd9;
  --paper: #f7f4ed;
  --white: #ffffff;
  --green: #176b54;
  --green-dark: #0f4b3d;
  --yellow: #f2b84b;
  --red: #b94b3f;
  --blue: #315f8f;
  --shadow: 0 18px 48px rgba(24, 32, 27, 0.13);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 5vw, 64px);
  background: rgba(247, 244, 237, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand,
.main-nav a {
  color: var(--ink);
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: var(--white);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 0.96rem;
}

.top-actions,
.actions-row,
.card-topline,
.quote-row,
.rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ghost-button,
.solid-button,
.search-button,
.service-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 750;
  text-decoration: none;
}

.ghost-button {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}

.solid-button,
.search-button {
  background: var(--green);
  color: var(--white);
}

.danger {
  background: var(--red);
}

.compact {
  min-height: 36px;
  padding: 0 13px;
  font-size: 0.9rem;
}

.nav-button {
  color: var(--white);
}

.hero {
  min-height: calc(100vh - 64px);
  display: grid;
  align-items: end;
  padding: clamp(28px, 5vw, 72px);
  background:
    linear-gradient(90deg, rgba(12, 28, 23, 0.82), rgba(12, 28, 23, 0.42), rgba(12, 28, 23, 0.12)),
    url("https://images.unsplash.com/photo-1632823471565-1ecdf5cdb4f8?auto=format&fit=crop&w=1800&q=80")
      center / cover;
  color: var(--white);
}

.hero-content {
  max-width: 1040px;
}

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

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

h1 {
  max-width: 850px;
  margin-bottom: 18px;
  font-size: clamp(2.4rem, 6vw, 5.7rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1rem, 1.4vw, 1.22rem);
  line-height: 1.6;
}

.search-panel {
  display: grid;
  grid-template-columns: 1.05fr 1.25fr 0.8fr 1fr 1fr auto;
  gap: 10px;
  margin-top: 32px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 6px;
}

.field label,
.filters label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.field input,
.field select,
.filters input,
.filters select,
.parts-search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf8;
  color: var(--ink);
  padding: 0 12px;
}

input[type="file"] {
  padding: 10px 12px;
}

.location-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.iconless {
  white-space: nowrap;
}

.search-panel .search-button {
  align-self: end;
  min-width: 138px;
}

.service-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 18px clamp(18px, 5vw, 64px);
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.service-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  background: #eef2ef;
  color: var(--ink);
}

.service-pill.active {
  background: var(--green-dark);
  color: var(--white);
}

.pill-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
}

.layout-grid {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 24px;
  padding: 32px clamp(18px, 5vw, 64px);
}

.filters {
  align-self: start;
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.filters h2 {
  margin-bottom: 2px;
  font-size: 1rem;
}

.filters label {
  display: grid;
  gap: 7px;
}

.results,
.parts-section {
  display: grid;
  gap: 16px;
}

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

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2.5vw, 2.2rem);
}

.provider-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.provider-card img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.provider-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.card-topline,
.quote-row {
  justify-content: space-between;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef2ef;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 850;
}

.badge.verified {
  background: #dcefe6;
}

.badge.featured {
  background: #fff0c7;
  color: #6b4c00;
}

.distance,
.provider-meta,
.team-line,
.seller,
.quote-row {
  color: var(--muted);
}

.provider-body h3,
.part-card h3 {
  margin-bottom: 0;
  font-size: 1.28rem;
}

.provider-meta,
.team-line {
  margin-bottom: 0;
  line-height: 1.45;
}

.rating-row strong {
  color: var(--green-dark);
  font-size: 1.25rem;
}

.actions-row {
  flex-wrap: wrap;
}

.parts-section,
.trust-section {
  padding: 32px clamp(18px, 5vw, 64px);
}

.parts-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.45fr) auto auto;
  gap: 10px;
}

.section-note {
  max-width: 860px;
  color: var(--muted);
  line-height: 1.55;
}

.parts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.part-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 330px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.part-card img {
  width: calc(100% + 36px);
  height: 170px;
  margin: -18px -18px 2px;
  border-radius: 8px 8px 0 0;
  object-fit: cover;
}

.part-card p,
.seller {
  margin-bottom: 0;
  line-height: 1.45;
}

.part-card strong {
  color: var(--blue);
  font-size: 1.25rem;
}

.trust-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  background: #17231e;
  color: var(--white);
}

.trust-section p {
  max-width: 650px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
}

.trust-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trust-list li {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px clamp(18px, 5vw, 64px);
  background: var(--white);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

footer span:first-child {
  color: var(--ink);
  font-weight: 850;
}

.admin-shell {
  display: grid;
  gap: 24px;
  padding: 32px clamp(18px, 5vw, 64px);
}

.admin-hero {
  display: grid;
  align-items: end;
  min-height: 360px;
  padding: clamp(24px, 4vw, 48px);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(12, 28, 23, 0.84), rgba(12, 28, 23, 0.38)),
    url("https://images.unsplash.com/photo-1487754180451-c456f719a1fc?auto=format&fit=crop&w=1600&q=80")
      center / cover;
  color: var(--white);
}

.admin-hero h1 {
  max-width: 900px;
  font-size: clamp(2.1rem, 4.8vw, 4.7rem);
}

.provider-hero {
  background:
    linear-gradient(90deg, rgba(12, 28, 23, 0.84), rgba(12, 28, 23, 0.38)),
    url("https://images.unsplash.com/photo-1486006920555-c77dcf18193c?auto=format&fit=crop&w=1600&q=80")
      center / cover;
}

.forum-hero {
  background:
    linear-gradient(90deg, rgba(12, 28, 23, 0.84), rgba(12, 28, 23, 0.38)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1600&q=80")
      center / cover;
}

.creator-hero {
  background:
    linear-gradient(90deg, rgba(12, 28, 23, 0.84), rgba(12, 28, 23, 0.38)),
    url("https://images.unsplash.com/photo-1551288049-bebda4e38f71?auto=format&fit=crop&w=1600&q=80")
      center / cover;
}

.auth-panel {
  max-width: 920px;
  margin: 0 auto;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.metric-card,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 170px;
  padding: 18px;
}

.metric-card span,
.metric-card p,
.request-row p,
.admin-form label {
  color: var(--muted);
}

.metric-card strong {
  color: var(--green-dark);
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.metric-card p {
  margin-bottom: 0;
  line-height: 1.45;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.admin-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.request-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.request-row h3,
.request-row p {
  margin-bottom: 4px;
}

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

.admin-form label {
  display: grid;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-form input,
.admin-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf8;
  color: var(--ink);
  padding: 0 12px;
}

.terms-row {
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center;
  font-size: 0.92rem !important;
  font-weight: 650 !important;
}

.terms-row input {
  width: 18px;
  min-height: 18px;
}

.compact-list {
  color: var(--white);
}

.terms-page {
  padding: 32px clamp(18px, 5vw, 64px);
}

.terms-document {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 46px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.terms-document h1 {
  max-width: 780px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.02;
}

.terms-document h2 {
  margin-top: 28px;
}

.terms-document p,
.terms-document li {
  color: var(--muted);
  line-height: 1.65;
}

.terms-document a,
.terms-row a {
  color: var(--green-dark);
  font-weight: 850;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}

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

.form-status {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.full-span {
  grid-column: 1 / -1;
}

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

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

  .search-panel .search-button {
    grid-column: 1 / -1;
  }

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

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

  .filters h2 {
    grid-column: 1 / -1;
  }

  .parts-grid,
  .trust-section,
  .admin-metrics,
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hero {
    min-height: auto;
    padding: 34px 18px 22px;
  }

  h1 {
    font-size: 2.45rem;
  }

  .search-panel,
  .filters,
  .provider-card,
  .parts-search,
  .location-control {
    grid-template-columns: 1fr;
  }

  .provider-card img {
    height: 210px;
    min-height: 210px;
  }

  .section-heading,
  footer,
  .request-row,
  .admin-form {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .admin-hero {
    min-height: auto;
  }
}
