/* Impact Equipment Rentals brand: Red #BF2B24 (Pantone 485 C), Black #212020, White.
   High-contrast light theme on purpose: this is read outdoors in sunlight. */
:root {
  --ink: #212020;          /* brand black */
  --paper: #ffffff;        /* brand white */
  --brand: #bf2b24;        /* brand red */
  --brand-press: #9e231d;
  --brand-tint: rgba(191, 43, 36, .28);
  --bg: #f1f0ee;
  --line: #cfcccb;
  --muted: #5c5958;
  --ok: #17703a;
  --bad: #8f1d17;          /* errors: deeper than brand red */
  --bad-bg: #fbe9e8;
  --radius: 12px;
  /* Proxima Nova is a licensed Adobe font; the phone's own sans-serif is a close stand-in. */
  --font: "Proxima Nova", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: Impact, Haettenschweiler, "Arial Narrow Bold", "Franklin Gothic Bold", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.4 var(--font);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 0; }

/* Top bar */
.topbar {
  background: var(--paper);
  color: var(--ink);
  border-bottom: 4px solid var(--brand);
  box-shadow: 0 3px 0 var(--ink);
  padding-top: env(safe-area-inset-top);
  position: sticky; top: 0; z-index: 10;
}
.topbar-inner {
  max-width: 560px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { display: block; height: 42px; width: auto; flex: none; }
.brand-app {
  font-family: var(--display); font-weight: 800; font-size: 17px; line-height: 1;
  text-transform: uppercase; letter-spacing: .5px; color: var(--brand);
  border-left: 2px solid var(--ink); padding-left: 10px; white-space: nowrap;
}
.gps-chip {
  flex: none; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
  background: #e4e2e1; color: var(--muted);
}
.gps-chip.on { background: var(--ok); color: #fff; }

/* Cards & steps */
.card, .step {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
h1 { font-family: var(--display); font-weight: 800; font-size: 26px; text-transform: uppercase; letter-spacing: .3px; margin: 0 0 6px; }
h2 { font-size: 19px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.num {
  display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none;
  border-radius: 50%; background: var(--brand); color: #fff; font-size: 15px; font-weight: 800;
}
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; padding: 40px 0; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* Fields */
.field { display: block; margin: 12px 0 0; }
.label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.opt { font-weight: 400; color: var(--muted); font-size: 13px; }
.hint { display: block; font-size: 13px; color: var(--muted); margin-top: 5px; }
input[type=text], input:not([type]), textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 13px 14px; border: 2px solid var(--line); border-radius: 10px; background: #fff;
  appearance: none; -webkit-appearance: none;
}
input:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--brand-tint); }
.big-input { font-size: 26px; font-weight: 800; letter-spacing: 1px; padding: 12px 14px; }
.field.invalid input { border-color: var(--bad); }
textarea { resize: vertical; min-height: 80px; }

.error {
  margin: 10px 0 0; padding: 9px 12px; border-radius: 10px;
  background: var(--bad-bg); color: var(--bad); font-weight: 700; font-size: 15px;
}

/* Buttons */
.btn {
  display: block; width: 100%; margin-top: 16px;
  font: inherit; font-weight: 800; font-size: 18px;
  padding: 15px 18px; border-radius: 12px; border: 2px solid var(--ink);
  cursor: pointer; touch-action: manipulation;
}
.btn-primary { background: var(--brand); border-color: var(--brand-press); color: #fff; text-transform: uppercase; letter-spacing: .6px; }
.btn-primary:active { background: var(--brand-press); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-xl { font-size: 20px; padding: 17px 18px; margin-top: 10px; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; font: inherit; font-size: 14px; padding: 12px; cursor: pointer; }

/* Event choice */
.events { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.event {
  text-align: left; font: inherit; color: var(--ink); background: #fff; cursor: pointer;
  border: 2px solid var(--line); border-radius: 12px; padding: 12px; min-height: 78px;
  touch-action: manipulation;
}
.event b { display: block; font-size: 17px; }
.event span { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }
.event[aria-checked=true] { background: var(--brand); border-color: var(--brand-press); color: #fff; box-shadow: inset 0 0 0 1px var(--brand-press); }
.event[aria-checked=true] span { color: #fff; }

/* Photo tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.tile {
  position: relative; display: block; aspect-ratio: 4 / 3; width: 100%;
  border: 2px dashed #a9a5a4; border-radius: 12px; background: #fafafa;
  overflow: hidden; cursor: pointer; padding: 0; font: inherit; color: var(--ink);
  touch-action: manipulation;
}
.tile-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; padding: 8px; text-align: center; }
.tile-empty svg { width: 64px; height: 64px; }
.tile-label { font-weight: 800; font-size: 15px; }
.tile-hint { font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile.done { border: 2px solid var(--ok); }
.tile-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 5px 8px;
  background: rgba(20,22,26,.78); color: #fff; font-size: 13px; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
.tile-badge { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: var(--ok); display: grid; place-items: center; }
.tile.busy::after {
  content: "Processing…"; position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(255,255,255,.85); font-weight: 700; font-size: 14px;
}
.tile.missing { border-color: var(--bad); }

/* Damage toggle */
.toggle { display: flex; gap: 12px; align-items: center; cursor: pointer; padding: 4px 0; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-box {
  width: 32px; height: 32px; flex: none; border: 2px solid var(--ink); border-radius: 8px; background: #fff;
  display: grid; place-items: center;
}
.toggle input:checked + .toggle-box { background: var(--brand); border-color: var(--brand-press); }
.toggle input:checked + .toggle-box::after { content: ""; width: 9px; height: 16px; border: solid #fff; border-width: 0 4px 4px 0; transform: translateY(-2px) rotate(45deg); }
.toggle input:focus-visible + .toggle-box { box-shadow: 0 0 0 3px var(--brand-tint); }

/* Submit bar */
body.has-bar { padding-bottom: 200px; }
.submitbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--paper); border-top: 3px solid var(--ink);
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
}
.submitbar > * { max-width: 528px; margin-left: auto; margin-right: auto; }
.summary { font-size: 15px; font-weight: 600; min-height: 21px; }
.summary.ready { color: var(--ink); }
.summary .big { font-size: 18px; font-weight: 800; }
.progress { height: 8px; background: #e4e2e1; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress-bar { height: 100%; width: 0; background: var(--ok); transition: width .2s; }
.error-bar { margin-top: 8px; }

.turnstile { display: flex; justify-content: center; margin: 4px 0 8px; }

/* Done */
.done { text-align: center; padding: 28px 18px; }
.done-check { color: var(--ok); margin-bottom: 8px; }
.done-line { font-size: 19px; font-weight: 700; margin: 6px 0; }

.foot { text-align: center; padding: 8px 0 24px; }

@media (min-width: 520px) {
  .tile-empty svg { width: 76px; height: 76px; }
}

/* Logo larger on the access-code screen */
.code-logo { display: block; width: 100%; max-width: 300px; height: auto; margin: 4px auto 18px; }

@media (max-width: 360px) {
  .brand-logo { height: 36px; }
  .brand-app { font-size: 15px; padding-left: 8px; }
}
