/* TorqueGuide App Styles — matches landing page design tokens */

:root {
  --bg: #0a0a0c;
  --bg-elevated: #131318;
  --bg-card: #1a1a22;
  --fg: #e8e6e3;
  --fg-muted: #8a8895;
  --fg-dim: #5a586a;
  --accent: #e07a2f;
  --accent-glow: rgba(224, 122, 47, 0.15);
  --accent-soft: #c46a28;
  --border: #2a2a35;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 6px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.accent { color: var(--accent); }
.mono { font-family: var(--font-mono); font-size: 0.88em; }

/* ── Navigation ── */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(10, 10, 12, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--fg);
}

.nav-links { display: flex; gap: 1.5rem; align-items: center; }

.nav-link {
  font-size: 0.9rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-link:hover, .nav-link.active { color: var(--fg); }

/* ── Search Page ── */
.search-page {
  min-height: calc(100vh - 60px);
  padding: 4rem 2rem 6rem;
  background:
    radial-gradient(ellipse 70% 50% at 60% 10%, var(--accent-glow), transparent),
    var(--bg);
}

.search-container { max-width: 820px; margin: 0 auto; }

.search-header {
  margin-bottom: 3rem;
}

.search-header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 1rem 0 1rem;
}

.search-sub {
  font-size: 1rem;
  color: var(--fg-muted);
  max-width: 580px;
  line-height: 1.7;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  padding: 0.4rem 1rem;
  border-radius: 2px;
  display: inline-block;
}

/* ── Selector Card ── */
.selector-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
}

.selector-row {
  margin-bottom: 2rem;
}
.selector-row:last-child { margin-bottom: 0; }

.selector-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  display: block;
  margin-bottom: 0.75rem;
}

.selector-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── Chips ── */
.chip {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--fg-dim); color: var(--fg); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Loading dots ── */
.selector-loading {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0.25rem 0;
}

.loading-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

.hidden { display: none !important; }

.error-text { color: var(--accent); font-size: 0.875rem; }

/* ── Vehicle Confirmed ── */
.vehicle-confirmed {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
}

.confirmed-header { margin-bottom: 2rem; }

.confirmed-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.confirmed-vehicle {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.confirmed-engine {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--fg-muted);
  margin-bottom: 1rem;
}

/* ── Procedure List ── */
.procedures-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 1rem;
}

.procedures-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
}

.procedure-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--fg);
  text-decoration: none;
  padding: 0.875rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}
.procedure-btn:hover {
  border-color: var(--accent);
  background: rgba(224, 122, 47, 0.06);
  color: var(--fg);
}
.procedure-name { flex: 1; }
.procedure-arrow { color: var(--accent); margin-left: 0.5rem; }

/* ── Buttons ── */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.25rem;
  border-radius: 4px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-soft); }

.btn-accent {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-accent:hover { background: var(--accent-soft); }

.btn-ghost {
  display: inline-block;
  background: transparent;
  color: var(--fg-muted);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.6rem 1.25rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--fg-dim); color: var(--fg); }

.btn-sm { font-size: 0.8rem; padding: 0.4rem 0.9rem; }

/* ── Guide Page ── */
.guide-page {
  min-height: calc(100vh - 60px);
  padding: 3rem 2rem 6rem;
  background:
    radial-gradient(ellipse 60% 40% at 50% 5%, var(--accent-glow), transparent),
    var(--bg);
}

.guide-container { max-width: 800px; margin: 0 auto; }

/* ── Loading spinner ── */
.guide-loading {
  text-align: center;
  padding: 6rem 2rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-message {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.loading-sub {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

/* ── Error state ── */
.guide-error {
  text-align: center;
  padding: 4rem 2rem;
}
.error-heading {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.error-body {
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* ── Guide header ── */
.guide-back {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--fg-muted);
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: color 0.15s;
}
.guide-back:hover { color: var(--fg); }

.guide-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.guide-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  letter-spacing: 0.05em;
}

.badge-difficulty { background: rgba(224, 122, 47, 0.15); color: var(--accent); }
.badge-time { background: var(--bg-card); color: var(--fg-muted); border: 1px solid var(--border); }
.badge-interval { background: var(--bg-card); color: var(--fg-muted); border: 1px solid var(--border); }

.diff-beginner   { background: rgba(74, 222, 128, 0.12); color: #4ade80; }
.diff-intermediate { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }
.diff-advanced   { background: rgba(248, 113, 113, 0.12); color: #f87171; }
.diff-professional { background: rgba(192, 132, 252, 0.12); color: #c084fc; }

.guide-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.3rem;
  line-height: 1.15;
}

.guide-vehicle-name {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.guide-overview {
  font-size: 1rem;
  color: var(--fg-muted);
  max-width: 640px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

/* ── Guide sections ── */
.guide-section {
  margin-bottom: 2.5rem;
}

.section-heading {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* ── Data tables ── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(42, 42, 53, 0.6);
  color: var(--fg-muted);
  vertical-align: top;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Tools ── */
.tools-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tool-chip {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.825rem;
  padding: 0.3rem 0.7rem;
  border-radius: 3px;
  font-family: var(--font-mono);
}

/* ── Steps ── */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step-card {
  display: flex;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.step-number {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.1rem;
}

.step-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--fg);
}

.step-instructions {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.65;
}

.step-warning {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: 3px;
  font-size: 0.825rem;
  color: #f87171;
}

/* ── Tips + warnings ── */
.tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tips-list li {
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border-left: 2px solid var(--accent);
  font-size: 0.9rem;
  color: var(--fg-muted);
  border-radius: 0 3px 3px 0;
}

.warning-card {
  padding: 0.75rem 1rem;
  background: rgba(248, 113, 113, 0.07);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: #f87171;
  margin-bottom: 1.5rem;
}

/* ── Upgrades ── */
.upgrades-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.upgrade-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.15s;
}
.upgrade-card:hover { border-color: var(--accent); }

.upgrade-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.upgrade-category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  display: block;
  margin-bottom: 0.2rem;
}

.upgrade-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
}

.upgrade-description {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.upgrade-meta {
  display: flex;
  gap: 2rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.cost-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 0.15rem;
}

.cost-value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
}
.cost-value.accent { color: var(--accent); }

.brands-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.brand-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--fg-muted);
}

.upgrade-notes {
  font-size: 0.825rem;
  color: var(--fg-dim);
  margin-top: 0.5rem;
  font-style: italic;
}

/* ── Build sequence ── */
.build-sequence-card {
  background: rgba(224, 122, 47, 0.06);
  border: 1px solid rgba(224, 122, 47, 0.2);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2rem;
}

.build-sequence-card h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.build-sequence-card p {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* ── Guide footer ── */
.guide-footer {
  display: flex;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ── Landing page nav link ── */
.hero-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid var(--accent-soft);
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  transition: all 0.15s;
}
.hero-cta-secondary:hover {
  background: var(--accent-glow);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .search-page, .guide-page { padding: 2rem 1rem 4rem; }
  .selector-card, .vehicle-confirmed { padding: 1.25rem; }
  .step-card { flex-direction: column; gap: 0.75rem; }
  .upgrade-meta { gap: 1rem; }
  .guide-footer { flex-direction: column; }
}
