*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Class display rules (e.g. .field-group flex) would otherwise override the hidden attribute */
[hidden] { display: none !important; }

:root {
  --brand: #1a1a2e;
  --accent: #e94560;
  --text: #1a1a1a;
  --muted: #666;
  --border: #ddd;
  --pass: #2e7d32;
  --fail: #c62828;
  --advisory: #e65100;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  color: var(--text);
  background: #f8f8f8;
  min-height: 100vh;
}

header {
  background: var(--brand);
  color: #fff;
  padding: 1.25rem 1rem;
  text-align: center;
}

header h1 { font-size: 1.5rem; letter-spacing: -0.5px; }
header p  { font-size: 0.875rem; opacity: 0.8; margin-top: 0.25rem; }

main {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* VRM form */
#vrn-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

#vrn-input {
  flex: 1;
  min-width: 0; /* allow shrinking below content size so the button isn't pushed off-screen at narrow widths */
  padding: 0.75rem 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

#vrn-input:focus {
  outline: none;
  border-color: var(--brand);
}

#vrn-form button {
  flex-shrink: 0;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

#vrn-form button:disabled { opacity: 0.6; cursor: not-allowed; }

/* Result */
#result { background: #fff; border-radius: 8px; padding: 1.25rem; border: 1px solid var(--border); }
#result h2 { font-size: 1rem; color: var(--muted); margin-bottom: 0.5rem; }
#result h3 { font-size: 0.875rem; color: var(--muted); margin: 1rem 0 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; }
#result p  { margin-bottom: 0.25rem; }

.result-passed { color: var(--pass); font-weight: 700; }
.result-failed  { color: var(--fail); font-weight: 700; }

/* Defects list */
#result ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
#result li { padding: 0.5rem 0.75rem; border-radius: 4px; font-size: 0.9rem; background: #fafafa; border-left: 3px solid var(--border); }

.defect-advisory { border-left-color: var(--advisory); }
.defect-major, .defect-fail { border-left-color: var(--fail); }

.defect-type {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 0.4rem;
  color: var(--muted);
}

.badge-danger {
  display: inline-block;
  background: var(--fail);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* Error */
#error {
  background: #fff3f3;
  border: 1px solid #f5c6c6;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  color: var(--fail);
  font-size: 0.9rem;
}

/* Vehicle card */
#vehicle-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.vehicle-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 0.25rem; }
.vehicle-name  { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.2rem; }
.vehicle-meta  { font-size: 0.875rem; color: var(--muted); margin-bottom: 0.4rem; }
.mot-line      { font-size: 0.875rem; }
.mot-none      { color: var(--muted); font-style: italic; }

.vehicle-status { margin-top: 0.5rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tax-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}
.tax-ok   { background: #e8f5e9; color: var(--pass); }
.tax-warn { background: #fff3e0; color: var(--advisory); }
.tax-bad  { background: #fdecea; color: var(--fail); }
.vehicle-status-source { font-size: 0.7rem; color: var(--muted); margin-top: 0.3rem; }

/* Quote form */
#quote-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
/* The #quote-form ID rule above beats the UA [hidden]{display:none} rule by
   specificity, so the form stayed visible — and interactable — before a
   vehicle was confirmed. This restores hidden's effect and also gives the
   user an explicit nudge to search first. */
#quote-form[hidden] {
  display: none;
}

/* Prompt shown in place of the (hidden) quote form until a vehicle is found */
#quote-prompt {
  font-size: 0.875rem;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
#quote-form label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
#quote-form select,
#quote-form input[type="number"] {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: #fff;
  width: 100%;
}
#quote-form select:focus,
#quote-form input[type="number"]:focus {
  outline: none;
  border-color: var(--brand);
}
#quote-form button {
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 0.25rem;
}
#quote-form button:disabled { opacity: 0.6; cursor: not-allowed; }

.field-hint { font-size: 0.8rem; color: var(--muted); margin-top: -0.25rem; }
.field-group { display: flex; flex-direction: column; gap: 0.5rem; }

/* Benchmark result */
.benchmark-card {
  margin-bottom: 1rem;
}
.benchmark-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); margin-bottom: 0.5rem; }
.benchmark-range { font-size: 1rem; margin-bottom: 0.25rem; }
.confidence-warning { font-size: 0.8rem; color: var(--advisory); background: #fff3e0; padding: 0.4rem 0.6rem; border-radius: 4px; margin-bottom: 0.75rem; }
.benchmark-basis { font-size: 0.875rem; font-weight: 600; color: var(--brand); margin-bottom: 0.25rem; }
.vat-note        { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.5rem; }
.your-quote      { font-size: 1rem; margin-bottom: 0.75rem; }

.verdict {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.verdict-ok   { background: #e8f5e9; color: var(--pass); }
.verdict-high { background: #fff3e0; color: var(--advisory); }
.verdict-low  { background: #e3f2fd; color: #1565c0; }

.safety-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--advisory);
  border: 1px solid var(--advisory);
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

/* Defects section */
.defects-section { margin-top: 1rem; }
.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

/* Disclaimer */
.disclaimer {
  margin-top: 1.5rem;
  font-size: 0.6875rem; /* 11sp equivalent */
  color: var(--muted);
  line-height: 1.5;
}

/* How we price explainer */
.how-we-price { font-size: 0.85rem; color: var(--muted); margin: 1rem 0; }
.how-we-price summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.how-we-price p { margin-top: 0.5rem; }

.verdict-gap { font-size: 0.875rem; margin-top: -0.4rem; margin-bottom: 0.75rem; }

/* Planned features: informational only */
.coming-soon {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.coming-soon-heading { font-weight: 700; color: var(--text); margin-bottom: 0.25rem; }
.coming-soon ul { padding-left: 1.2rem; margin-top: 0.25rem; }
