:root {
  --bg: #0e1116;
  --panel: #161b22;
  --panel-2: #1c232c;
  --border: #2a323d;
  --text: #e6edf3;
  --muted: #8b97a4;
  --accent: #ff7a1a;
  --accent-hover: #ff8c3b;
  --good: #2ea043;
  --warn: #d29922;
  --bad: #f85149;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

header {
  text-align: center;
  margin-bottom: 28px;
}

header h1 {
  margin: 0 0 6px;
  font-size: 28px;
  letter-spacing: 0.3px;
}

header .accent { color: var(--accent); }

header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

form .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  form .row { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
input[type="date"] {
  width: 100%;
  padding: 11px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}

input:focus {
  outline: none;
  border-color: var(--accent);
}

input[name="vin"] {
  text-transform: uppercase;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 1px;
}

.help {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}

button {
  margin-top: 18px;
  width: 100%;
  padding: 13px 16px;
  background: var(--accent);
  color: #0e1116;
  border: 0;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

button:hover:not(:disabled) { background: var(--accent-hover); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.error {
  color: var(--bad);
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 16px;
}

.hidden { display: none !important; }

.vehicle-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.vehicle-info .item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.vehicle-info .item .k {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vehicle-info .item .v {
  font-size: 15px;
  font-weight: 500;
  margin-top: 2px;
}

.warranty-section {
  margin-top: 20px;
}

.warranty-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.warranty-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}

.warranty-card .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.warranty-card .name {
  font-weight: 600;
  font-size: 15px;
}

.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.good { background: rgba(46, 160, 67, 0.18); color: #4ac26b; }
.badge.warn { background: rgba(210, 153, 34, 0.18); color: #e3b341; }
.badge.bad  { background: rgba(248, 81, 73, 0.18); color: #ff6a63; }

.warranty-card .terms {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.bars { display: grid; gap: 10px; }

.bar-row .bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}

.bar-row .bar-label .left { color: var(--text); }
.bar-row .bar-label .right { color: var(--muted); }

.bar {
  height: 8px;
  background: #0b0e13;
  border-radius: 999px;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--good), #4ac26b);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.bar.warn > span { background: linear-gradient(90deg, var(--warn), #e3b341); }
.bar.bad  > span { background: linear-gradient(90deg, var(--bad), #ff8a85); }

.disclaimer {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 16px;
  padding: 12px;
  background: var(--panel-2);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 30px;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #0e1116;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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