/* RepairXpert Industrial — Dark theme, mobile-first, warehouse-readable */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #1c2129;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #f78166;
  --green: #3fb950;
  --blue: #58a6ff;
  --yellow: #d29922;
  --red: #f85149;
  --radius: 8px;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
header {
  background: var(--surface);
  border-bottom: 2px solid var(--accent);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
header .logo-row {
  display: flex;
  align-items: center;
}
header .logo-row img {
  height: 40px;
  width: auto;
}
header h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
header .badge {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(247,129,102,0.15);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
header nav {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
}
header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
header nav a:hover,
header nav a.active {
  background: var(--surface2);
  color: var(--text);
}

/* ── Layout ── */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 1rem;
  font-weight: 600;
}

/* ── Forms ── */
label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  font-weight: 500;
}
select, input[type=text], textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
}
textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Photo upload ── */
.photo-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 0.85rem;
}
.photo-upload:hover {
  border-color: var(--accent);
  background: rgba(247,129,102,0.03);
}
.photo-upload input[type=file] { display: none; }
.photo-upload p { color: var(--muted); font-size: 0.85rem; }
.photo-upload .icon { font-size: 1.8rem; margin-bottom: 0.3rem; }
.photo-preview {
  max-width: 100%;
  border-radius: 6px;
  margin-top: 0.5rem;
  display: none;
}

/* ── Buttons ── */
.btn {
  width: 100%;
  padding: 0.9rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-secondary {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: var(--border); }
a.btn {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: 0.75rem;
}

/* ── Results ── */
.fault-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.fault-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.fault-code-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: rgba(88,166,255,0.12);
  color: var(--blue);
  white-space: nowrap;
}
.fault-desc {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* Severity badges */
.severity {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.severity.critical { background: rgba(248,81,73,0.15); color: var(--red); }
.severity.high { background: rgba(247,129,102,0.15); color: var(--accent); }
.severity.medium { background: rgba(210,153,34,0.15); color: var(--yellow); }
.severity.low { background: rgba(63,185,80,0.15); color: var(--green); }

/* Confidence */
.confidence {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-weight: 600;
}
.confidence.high { background: rgba(63,185,80,0.12); color: var(--green); }
.confidence.med { background: rgba(210,153,34,0.12); color: var(--yellow); }
.confidence.low { background: rgba(248,81,73,0.12); color: var(--red); }

/* Meta row */
.meta-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

/* ── Cause list ── */
.cause-list {
  list-style: none;
  padding: 0;
}
.cause-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  line-height: 1.55;
  padding-left: 1.5rem;
  position: relative;
}
.cause-list li:last-child { border: none; }
.cause-list li::before {
  content: '\25B8';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ── Step list ── */
.step-list {
  list-style: none;
  padding: 0;
}
.step-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  line-height: 1.55;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}
.step-list li:last-child { border: none; }
.step-num {
  background: var(--accent);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Special callout boxes ── */
.callout {
  border-radius: 6px;
  padding: 1rem;
  margin-top: 1rem;
}
.callout h4 {
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
  font-weight: 700;
}
.callout-trick {
  background: rgba(247,129,102,0.06);
  border: 1px solid rgba(247,129,102,0.2);
}
.callout-trick h4 { color: var(--accent); }
.callout-photo {
  background: rgba(88,166,255,0.06);
  border: 1px solid rgba(88,166,255,0.2);
}
.callout-photo h4 { color: var(--blue); }
.callout p, .callout li {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ── History ── */
.history-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.history-entry:hover { border-color: var(--blue); }
.history-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.history-meta .ts {
  font-size: 0.75rem;
  color: var(--muted);
}
.history-detail {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.history-entry.open .history-detail { display: block; }
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}
.empty-state p { font-size: 0.9rem; }

/* ── Spinner ── */
.spinner {
  display: none;
  text-align: center;
  padding: 2rem;
}
.spinner::after {
  content: '';
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Quick Help ── */
.quick-help { border-color: rgba(63,185,80,0.25); }
.quick-help h2 { color: var(--green); }
.quick-help-list {
  list-style: none;
  padding: 0;
}
.quick-help-list li {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  line-height: 1.55;
}
.quick-help-list li:last-child { border: none; }
.quick-help-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Suggested Parts ── */
.parts-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.parts-item:last-of-type { margin-bottom: 0; }

.parts-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.65rem;
}
.parts-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.parts-partno {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}
.parts-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}
.parts-suppliers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.btn-buy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: #238636;
  color: #fff;
  border: 1px solid #2ea043;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  cursor: pointer;
  white-space: nowrap;
}
.btn-buy:hover {
  background: #2ea043;
  transform: translateY(-1px);
}
.btn-buy:active {
  transform: translateY(0);
}
.btn-buy-price {
  background: rgba(0,0,0,0.25);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── Pricing ── */
.pricing-container { max-width: 720px; }

.pricing-card {
  position: relative;
  transition: border-color 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.pricing-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}
.pricing-featured {
  margin-top: 0.5rem;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 24px rgba(247,129,102,0.1);
}
.pricing-popular {
  position: absolute;
  top: -0.65rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.75rem;
  border-radius: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.pricing-tier-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.pricing-tier-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.pricing-tier-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 1px;
}
.pricing-free {
  background: rgba(63,185,80,0.15);
  color: var(--green);
}
.pricing-pro {
  background: rgba(247,129,102,0.15);
  color: var(--accent);
}
.pricing-enterprise {
  background: rgba(88,166,255,0.15);
  color: var(--blue);
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
}
.pricing-amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.pricing-period {
  font-size: 0.85rem;
  color: var(--muted);
}

.pricing-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}
.pricing-features li {
  padding: 0.45rem 0;
  font-size: 0.85rem;
  padding-left: 1.6rem;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.pricing-features li:last-child { border: none; }
.pricing-features li::before {
  position: absolute;
  left: 0;
  font-weight: 700;
  font-size: 0.85rem;
}
.pricing-features li.included::before {
  content: '\2713';
  color: var(--green);
}
.pricing-features li.excluded {
  color: var(--muted);
  opacity: 0.5;
}
.pricing-features li.excluded::before {
  content: '\2715';
  color: var(--muted);
}

/* FAQ */
.faq-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.faq-item:last-child { border: none; }
.faq-item strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.faq-item p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Comparison Tables ── */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.compare-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  border-bottom: 2px solid var(--border);
  color: var(--muted);
}
.compare-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table td:first-child {
  color: var(--text);
  font-weight: 500;
}
.cmp-yes {
  color: var(--green);
  font-weight: 600;
}
.cmp-no {
  color: var(--red);
  opacity: 0.7;
}
.cmp-na {
  color: var(--muted);
  font-style: italic;
}
.compare-link-card {
  transition: border-color 0.15s, transform 0.15s;
}
.compare-link-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .container { padding: 0.5rem; }
  .card { padding: 1rem; }
  header h1 { font-size: 1rem; }
  .parts-suppliers { flex-direction: column; }
  .btn-buy { justify-content: center; }
  .pricing-amount { font-size: 1.6rem; }
}
/* ── Pricing Conversion Additions ── */

/* Launch pricing urgency badge */
.launch-pricing-badge {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.4rem 1rem;
  background: rgba(210,153,34,0.15);
  color: var(--yellow);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

/* Money-back guarantee text below CTA buttons */
.pricing-guarantee {
  text-align: center;
  font-size: 0.75rem;
  color: var(--green);
  margin-top: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* Trust bar */
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}
.trust-bar span:not(.trust-sep) {
  font-weight: 600;
  color: var(--text);
}
.trust-sep {
  color: var(--muted);
  font-weight: 400;
}

/* Comparison table enhancements */
.compare-yes {
  color: var(--green);
  font-weight: 700;
}
.compare-no {
  color: var(--muted);
  opacity: 0.4;
}

/* ── Feedback ── */
.feedback-card { text-align: center; }
.feedback-buttons { display: flex; gap: 0.75rem; justify-content: center; }
.btn-feedback {
  padding: 0.6rem 2rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.btn-feedback:hover { background: var(--border); }
.btn-yes:hover, .btn-yes:focus { border-color: var(--green); color: var(--green); }
.btn-no:hover, .btn-no:focus { border-color: var(--red); color: var(--red); }
.feedback-comment textarea {
  width: 100%;
  max-width: 400px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
}
.feedback-summary {
  border-left: 3px solid var(--accent);
}
