/* Car show check-in — mobile first, small, fast.
   Everything lives here: no inline styles, because the CSP forbids them. */

:root {
  --bg: #0d1117;
  --card: #161b22;
  --line: #262d38;
  --text: #e8edf4;
  --muted: #8b97a8;
  --accent: #ff5a1f;
  --accent-hi: #ff7a45;
  --ok: #2ea043;
  --err: #f85149;
  --radius: 14px;
}

* { box-sizing: border-box; }

/* [hidden] is only `display:none` from the UA stylesheet, so an explicit display
   rule below (.btn is display:block) would quietly beat it. Make it authoritative. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px calc(32px + env(safe-area-inset-bottom));
}

/* Deliberately loud: this is the "you left it on" alarm. Not themeable — it must
   stand out against whatever colours are configured. */
.testbar {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #4d2c00;
  border: 1px solid #b26b00;
  color: #ffd79a;
  font-size: 13.5px;
  text-align: center;
}
.testbar b { color: #ffb84d; }

/* ---------- Hero ---------- */

.hero { margin-bottom: 20px; }

/* If public/img/truck.jpg exists it shows; if not, this gradient stands in so
   the page never looks broken before a photo is added. */
/* The fade and the placeholder are derived from the theme colours, so changing
   the background in admin doesn't leave a hard-coded dark band behind. */
.hero-img {
  height: 190px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, transparent 40%, var(--bg) 100%),
    linear-gradient(135deg,
      color-mix(in srgb, var(--card) 70%, var(--text)) 0%,
      color-mix(in srgb, var(--card) 45%, var(--text)) 50%,
      var(--card) 100%);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
  position: relative;
}
.hero-img.has-photo {
  background-image:
    linear-gradient(180deg, transparent 45%, var(--bg) 100%),
    var(--photo);
}

.hero-text { padding: 16px 4px 0; }

.kicker {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.sub { margin: 0; color: var(--muted); font-size: 16px; }

/* ---------- Card ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
}

.field { display: block; margin-bottom: 16px; }

.label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}
.label em {
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}

input[type="text"], textarea {
  width: 100%;
  padding: 13px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  /* 16px minimum, or iOS Safari zooms in on focus and the layout jumps. */
  font: inherit;
  font-size: 16px;
  resize: vertical;
}
input[type="text"]:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
::placeholder { color: color-mix(in srgb, var(--muted) 65%, transparent); }

.hint {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  min-height: 1em;
}

/* Honeypot: off-screen, not display:none — some bots skip hidden fields. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Button ---------- */

.btn {
  display: block;
  width: 100%;
  /* Big enough to hit one-handed while holding a drink at a car show. */
  padding: 17px 20px;
  margin-top: 4px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, transform .06s;
}
.btn:active { transform: scale(.985); }
.btn:hover { background: var(--accent-hi); }
.btn:disabled { opacity: .6; cursor: default; }

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  padding: 12px;
  margin-top: 18px;
}
.btn.ghost:hover {
  background: color-mix(in srgb, var(--card) 80%, var(--text));
  color: var(--text);
}

.fine {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

.err {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: rgba(248, 81, 73, .1);
  border: 1px solid rgba(248, 81, 73, .35);
  border-radius: 8px;
  color: #ffb3ae;
  font-size: 14px;
}

/* ---------- Thanks ---------- */

.thanks { text-align: center; }

.check {
  width: 62px;
  height: 62px;
  margin: 4px auto 14px;
  border-radius: 50%;
  background: rgba(46, 160, 67, .15);
  border: 1px solid rgba(46, 160, 67, .5);
  color: var(--ok);
  font-size: 30px;
  line-height: 60px;
  font-weight: 700;
}

.thanks h2 { margin: 0 0 8px; font-size: 24px; }
.thanks-sub { margin: 0; color: var(--muted); }

.counter {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.counter strong {
  display: block;
  font-size: 40px;
  line-height: 1.1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.counter span { font-size: 14px; color: var(--muted); }

/* ---------- Footer ---------- */

.foot {
  margin-top: 22px;
  text-align: center;
  font-size: 13px;
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}
.foot p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
