:root {
  --red: #AF2B1E;        /* RAL 3000 */
  --yellow: #FFD400;     /* hi-vis */
  --graphite: #26282B;
  --graphite-2: #34373B;
  --offwhite: #F5F4F1;
  --ink: #1B1C1E;
  --muted: #6B6E72;
  --line: #DDDBD6;
  --ok: #2E7D32;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--offwhite);
  color: var(--ink);
  min-height: 100vh;
}

h1, h2, h3, .logo, .btn, .badge, label {
  font-family: 'Oswald', 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.topbar { background: var(--graphite); position: sticky; top: 0; z-index: 10; }
.topbar-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; max-width: 560px; margin: 0 auto;
}
.logo { color: #fff; font-weight: 700; font-size: 1.15rem; }
.logo::first-letter { color: var(--yellow); }

.hazard, .hazard-thin {
  height: 10px;
  background: repeating-linear-gradient(-45deg,
    var(--yellow) 0 14px, var(--red) 14px 28px);
}
.hazard-thin { height: 6px; }

.container { max-width: 560px; margin: 0 auto; padding: 20px 16px 60px; }

h1 { font-size: 1.4rem; margin-bottom: 4px; }
h2 { font-size: 1.1rem; margin: 20px 0 10px; }
.sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 18px; }

/* Forms */
.field { margin-bottom: 14px; }
label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 5px; color: var(--graphite); }
input[type=text], input[type=email], input[type=password],
input[type=datetime-local], textarea {
  width: 100%; padding: 12px; font: inherit; font-size: 1rem;
  border: 2px solid var(--line); border-radius: 8px; background: #fff;
}
input:focus, textarea:focus { outline: none; border-color: var(--graphite); }
textarea { min-height: 80px; resize: vertical; }

.btn {
  display: block; width: 100%; padding: 15px; border: none; border-radius: 8px;
  font-size: 1.05rem; font-weight: 600; cursor: pointer; margin-top: 8px;
}
.btn-primary { background: var(--yellow); color: var(--ink); }
.btn-primary:active { filter: brightness(0.92); }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; border: 2px solid var(--graphite); color: var(--graphite); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.link-btn {
  background: none; border: none; color: var(--yellow); font: inherit;
  font-size: 0.9rem; cursor: pointer; text-decoration: underline;
}
.link-btn.dark { color: var(--graphite); }

/* Vehicle list */
.vehicle {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: #fff; border: 2px solid var(--line); border-radius: 10px;
  padding: 14px; margin-bottom: 10px; cursor: pointer; width: 100%; text-align: left;
}
.vehicle:disabled { cursor: not-allowed; background: #EFEDE9; }
.vehicle.optaget { border-color: var(--red); position: relative; overflow: hidden; }
.vehicle.optaget::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 8px;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 8px, var(--red) 8px 16px);
}
.vehicle .plade { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 1.1rem; }
.vehicle .model { color: var(--muted); font-size: 0.85rem; }
.badge {
  font-size: 0.72rem; font-weight: 600; padding: 4px 9px; border-radius: 99px; white-space: nowrap;
}
.badge.ledig { background: #E3EFE4; color: var(--ok); }
.badge.optaget { background: var(--red); color: #fff; }
.badge.min { background: var(--yellow); color: var(--ink); }

/* Photo grid */
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.photo-tile {
  position: relative; border: 2px dashed var(--line); border-radius: 10px;
  aspect-ratio: 4/3; background: #fff; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.photo-tile.filled { border-style: solid; border-color: var(--ok); }
.photo-tile input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile .tile-label {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px;
  background: rgba(38, 40, 43, 0.85); color: #fff;
  font-family: 'Oswald', sans-serif; font-size: 0.72rem; text-transform: uppercase;
}
.photo-tile .cam { font-size: 1.8rem; color: var(--muted); }

/* Active view */
.statuscard {
  background: var(--graphite); color: #fff; border-radius: 12px;
  padding: 18px; margin-bottom: 16px; overflow: hidden; position: relative;
}
.statuscard .plade { font-family: 'Oswald', sans-serif; font-size: 1.6rem; font-weight: 700; }
.statuscard .rows { margin-top: 12px; font-size: 0.92rem; display: grid; gap: 6px; }
.statuscard .rows b { color: var(--yellow); font-weight: 600; }
.countdown { font-family: 'Oswald', sans-serif; font-size: 1.3rem; }
.countdown.overdue { color: var(--yellow); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

/* Receipt */
.receipt-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 10px 0; }
.receipt-grid img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line);
}
.okbox {
  background: #E3EFE4; border: 2px solid var(--ok); color: var(--ok);
  border-radius: 10px; padding: 14px; margin-bottom: 16px; font-weight: 500;
}
.infobox {
  background: #FFF7D6; border: 2px solid var(--yellow);
  border-radius: 10px; padding: 12px; margin: 12px 0; font-size: 0.9rem;
}

/* Toast + lightbox */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--red); color: #fff; padding: 12px 20px; border-radius: 8px;
  font-weight: 500; z-index: 50; max-width: 90%; text-align: center;
}
.toast.ok { background: var(--graphite); border-left: 6px solid var(--yellow); }
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 100;
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; }

.hidden { display: none !important; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.spinner {
  width: 28px; height: 28px; margin: 30px auto; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--red);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
