:root {
  --bg: #09131a;
  --bg-soft: #11222c;
  --panel: #f0f4f6;
  --ink: #17222a;
  --ink-soft: #56707f;
  --accent: #ec6a2f;
  --accent-strong: #d25019;
  --line: #c4d1d8;
  --ok: #0e9f6e;
  --warn: #b88312;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  background-color: #09131a;
  background-image:
    linear-gradient(rgba(7, 16, 22, 0.78), rgba(7, 16, 22, 0.82)),
    url("https://images.unsplash.com/photo-1487754180451-c456f719a1fc?auto=format&fit=crop&w=1920&q=80");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.bg-orb {
  position: fixed;
  z-index: -1;
  border-radius: 100%;
  filter: blur(50px);
  opacity: 0.45;
}

.orb-a {
  width: 280px;
  height: 280px;
  background: #ef8634;
  top: -70px;
  right: -80px;
}

.orb-b {
  width: 220px;
  height: 220px;
  background: #2f6e94;
  bottom: 20%;
  left: -90px;
}

.site-header,
main {
  width: min(1180px, 92vw);
  margin: 0 auto;
}

.site-header {
  padding: 28px 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #eef6f8;
}

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

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

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, #ec6a2f 0%, #d25019 100%);
}

.brand-eyebrow {
  margin: 0;
  color: #a5c0cc;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.site-header h1 {
  font-size: clamp(1.2rem, 1.7vw, 1.6rem);
}

main {
  padding: 10px 0 28px;
  display: grid;
  gap: 18px;
}

.search-panel,
.mission-panel,
.results-shell {
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid #dce7ec;
  box-shadow: 0 20px 45px rgba(4, 16, 26, 0.2);
}

.search-panel {
  padding: clamp(18px, 2.6vw, 28px);
  display: grid;
  gap: 16px;
  animation: rise 0.6s ease-out both;
}

.mission-panel {
  padding: clamp(18px, 2.4vw, 26px);
  display: grid;
  gap: 14px;
  animation: rise 0.68s ease-out both;
}

.mission-copy {
  margin: 0;
  color: #2d4a58;
  line-height: 1.7;
  max-width: 900px;
}

.vision-card {
  border: 1px solid #d7e2e8;
  border-radius: 14px;
  background: linear-gradient(150deg, #ffffff 0%, #f4f9fc 100%);
  padding: 16px;
  display: grid;
  gap: 8px;
}

.vision-card h3 {
  font-size: 1.05rem;
}

.vision-card p {
  margin: 0;
  color: #31505f;
  line-height: 1.65;
}

.panel-intro .kicker {
  margin: 0;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  font-weight: 600;
}

.panel-intro h2 {
  margin-top: 6px;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.search-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 12px;
  align-items: end;
}

.nlp-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.nlp-label {
  margin: 0;
}

.nlp-btn {
  min-width: 120px;
}

.nlp-status {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 16px;
  font-size: 12px;
  color: #2f5c73;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}

select,
input,
button {
  font: inherit;
}

select,
input[type="text"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 42px;
  padding: 0 12px;
  background: #fff;
  color: #12232d;
}

input:focus,
select:focus {
  outline: 2px solid #8eb5c9;
  outline-offset: 1px;
}

.primary-btn,
.ghost-btn {
  border-radius: 10px;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  font-weight: 600;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(155deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
}

.primary-btn:hover {
  filter: brightness(1.06);
}

.ghost-btn {
  border: 1px solid #b2c3cb;
  color: #f4f8fa;
  background: transparent;
}

.ghost-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.results-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  overflow: hidden;
  animation: rise 0.75s ease-out both;
}

.filters-panel {
  padding: 20px;
  border-right: 1px solid #dbe7ed;
  background: linear-gradient(180deg, #e8f0f4 0%, #f0f4f6 100%);
  display: grid;
  gap: 14px;
  align-content: start;
}

.filters-panel h3 {
  font-size: 1.05rem;
}

input[type="range"] {
  width: 100%;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.checkbox-row input {
  width: 17px;
  height: 17px;
}

.results-panel {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.results-topbar {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.results-topbar p {
  margin: 4px 0 0;
  color: var(--ink-soft);
}

.results-topbar .ghost-btn {
  color: #264554;
  border-color: #b7c9d2;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 12px;
}

.part-card {
  border: 1px solid #d4e1e8;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  display: grid;
  gap: 8px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.part-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(8, 24, 36, 0.13);
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.part-name {
  margin: 0;
  font-weight: 600;
}

.condition-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--warn);
}

.vehicle-fit,
.seller-city {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.metric-row,
.seller-row,
.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.metric {
  font-size: 14px;
  font-weight: 700;
}

.metric.price {
  color: var(--accent-strong);
}

.metric.distance {
  color: #24566d;
}

.seller-name {
  font-size: 13px;
}

.warranty-tag,
.stock-tag {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #e7eef2;
}

.warranty-tag.active {
  color: #0d7956;
  background: #d8f0e7;
}

.stock-tag.empty {
  color: #8f2b25;
  background: #f8d9d6;
}

.primary-btn.full {
  width: 100%;
  min-height: 38px;
}

.roadmap-panel {
  gap: 22px;
}

.helper-panel {
  max-width: 720px;
}

.helper-card {
  border: 1px solid #d4e1e8;
  border-radius: 14px;
  padding: 18px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.helper-label {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #3c667b;
  font-weight: 700;
}

.helper-email {
  width: fit-content;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.1rem, 2.8vw, 1.5rem);
  font-weight: 700;
  color: var(--accent-strong);
  text-decoration: none;
}

.helper-email:hover {
  color: var(--accent);
}

.helper-note {
  margin: 0;
  color: #32505f;
}

.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

.roadmap-card {
  border: 1px solid #d4e1e8;
  border-radius: 14px;
  padding: 16px;
  background: #ffffff;
  display: grid;
  gap: 10px;
}

.roadmap-card h3 {
  font-size: 1.05rem;
  line-height: 1.35;
}

.roadmap-card p {
  margin: 0;
  color: #32505f;
}

.roadmap-card ul {
  margin: 0;
  padding-left: 18px;
  color: #2f4f61;
}

.vote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.vote-btn {
  min-height: 36px;
  padding: 0 12px;
}

.emoji-vote-btn {
  width: 42px;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid #c0d0d8;
  background: #ffffff;
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.emoji-vote-btn:hover {
  background: #f3f8fb;
}

.vote-btn:disabled {
  opacity: 0.75;
  cursor: default;
}

.vote-count {
  font-size: 13px;
  font-weight: 600;
  color: #31505e;
}

.vote-status {
  min-height: 18px;
  margin: 0;
  font-size: 12px;
  color: #507181;
}

.vote-status.ok {
  color: #0d7b57;
}

.vote-status.warn {
  color: #9c5d10;
}

.roadmap-tag {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: #9a5b0f;
  background: #ffefdb;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
}

body.modal-open {
  overflow: hidden;
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(4, 12, 17, 0.72);
  display: grid;
  place-items: center;
  padding: 16px;
}

.auth-backdrop[hidden] {
  display: none !important;
}

.auth-modal {
  width: min(460px, 100%);
  border-radius: 16px;
  border: 1px solid #d2e0e8;
  background: #f6fbff;
  padding: 18px;
  display: grid;
  gap: 12px;
  position: relative;
  color: #17303d;
  box-shadow: 0 30px 50px rgba(4, 16, 26, 0.45);
}

.auth-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid #cad7df;
  background: #fff;
  color: #1e3f4f;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.auth-title {
  margin-right: 28px;
  font-size: 1.28rem;
}

.auth-subtitle {
  margin: 0;
  color: #496676;
  font-size: 13px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.auth-tab {
  min-height: 38px;
  border-radius: 9px;
  border: 1px solid #c4d4dd;
  background: #fff;
  color: #245365;
  font-weight: 600;
  cursor: pointer;
}

.auth-tab.active {
  border-color: #df6b30;
  color: #fff;
  background: linear-gradient(155deg, var(--accent) 0%, var(--accent-strong) 100%);
}

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

.auth-form[hidden],
.auth-account[hidden],
.auth-tabs[hidden],
.auth-row[hidden] {
  display: none !important;
}

.auth-row {
  display: grid;
  gap: 5px;
  font-size: 12px;
}

.auth-row span {
  color: #345c6e;
}

.auth-row input {
  min-height: 40px;
}

.auth-submit {
  margin-top: 4px;
}

.auth-message {
  min-height: 18px;
  margin: 0;
  font-size: 12px;
  color: #4f7180;
}

.auth-message.ok {
  color: #0d7b57;
}

.auth-message.warn {
  color: #a06012;
}

.auth-account {
  display: grid;
  gap: 10px;
}

.auth-account-text {
  margin: 0;
  color: #315869;
  font-weight: 600;
}

.auth-sign-out-btn {
  color: #244957;
}

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

@media (max-width: 1040px) {
  .search-form {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .results-shell {
    grid-template-columns: 1fr;
  }

  .filters-panel {
    border-right: 0;
    border-bottom: 1px solid #dbe7ed;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    align-items: end;
  }

  .filters-panel h3 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .search-form {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .nlp-row {
    grid-template-columns: 1fr;
  }

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

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

  .site-header {
    padding-top: 20px;
  }

  .site-header .sign-in-btn {
    display: none;
  }

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