:root {
  --red: #E2231A; --red-dark: #b01810; --black: #111; --gold: #F2B705;
  --ink: #1a1a1a; --muted: #666; --line: #d6d6d6; --bg: #f3f1ec; --err: #d01414;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--black); color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  overscroll-behavior: none;
}
.loading { color: #fff; padding: 40px; text-align: center; }
h1, h2, .brand, .btn { font-family: Impact, "Arial Narrow Bold", "Roboto Condensed", system-ui, sans-serif; letter-spacing: .02em; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  background: var(--black); color: #fff; padding: 10px 14px; border-bottom: 4px solid var(--red);
}
.bar .brand { flex: 1; font-size: 22px; text-transform: uppercase; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar button { background: none; border: 0; color: #fff; font-size: 17px; padding: 8px 10px; min-height: 44px; cursor: pointer; }
.bar .gear { font-size: 26px; line-height: 1; }

/* ---------- layout ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 18px 14px 60px; }
.card { background: #fff; border-radius: 10px; padding: 22px 18px; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.center { text-align: center; }
.muted { color: var(--muted); font-size: 15px; }
.hero { text-align: center; color: #fff; padding: 26px 10px 8px; }
.hero .name { font: 46px/1 Impact, "Arial Narrow Bold", sans-serif; text-transform: uppercase; color: var(--gold); text-shadow: 3px 3px 0 var(--red); letter-spacing: .03em; }
.hero .sub { margin-top: 10px; font-size: 18px; color: #ddd; }

.btn {
  display: block; width: 100%; padding: 16px 18px; margin: 12px 0; min-height: 58px;
  font-size: 22px; text-transform: uppercase; text-align: center; cursor: pointer;
  background: var(--red); color: #fff; border: 0; border-radius: 8px; box-shadow: 0 3px 0 var(--red-dark);
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--red-dark); }
.btn.dark { background: var(--black); box-shadow: 0 3px 0 #000; }
.btn.ghost { background: #fff; color: var(--black); border: 2px solid var(--black); box-shadow: none; }
.btn.small { font-size: 17px; min-height: 46px; padding: 10px 14px; width: auto; display: inline-block; margin: 6px 6px 6px 0; }
.btn[disabled] { opacity: .45; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .choice { grid-template-columns: 1fr; } }
.choice button { background: #fff; border: 2px solid var(--black); border-radius: 10px; padding: 18px 14px; text-align: left; cursor: pointer; font: inherit; min-height: 96px; }
.choice button b { display: block; font-size: 20px; }
.choice button span { color: var(--muted); font-size: 15px; }
.choice button:active { background: #fff3c4; }

.status { text-align: center; padding: 10px 12px; border-radius: 8px; margin: 14px 0; font-weight: 600; }
.status.ok { background: #e2f4e1; color: #17601a; }
.status.wait { background: var(--gold); color: #111; }
.status.bad { background: #fde3e1; color: #8c1109; }

/* ---------- waiver text ---------- */
.doc h1 { font-size: 21px; line-height: 1.25; text-align: center; margin: 4px 0 14px; }
.doc h2 { font-size: 18px; margin: 22px 0 8px; }
.doc p, .doc li { font-size: 16px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc .important { background: #fff3c4; border-left: 5px solid var(--gold); padding: 10px 12px; }

/* ---------- fields ---------- */
.field { margin: 18px 0; }
.field > label, .field > .label { display: block; font-weight: 700; margin-bottom: 6px; }
.req::after { content: " *"; color: var(--err); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel], select {
  width: 100%; font: inherit; font-size: 18px; padding: 12px 10px; min-height: 50px;
  border: 2px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 3px solid var(--gold); border-color: var(--black); }
.locked { padding: 12px 10px; background: #eee; border-radius: 6px; font-size: 18px; }
.signbox {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 130px;
  background: #ececec; border: 2px dashed #999; border-radius: 6px; color: #888; font-size: 30px; cursor: pointer; padding: 0;
}
.signbox img { max-width: 100%; max-height: 170px; display: block; }
.signbox.done { background: #fff; border-style: solid; border-color: var(--line); }
.errmsg { display: none; color: var(--err); font-weight: 600; margin-top: 5px; }
.invalid .errmsg { display: block; }
.invalid input, .invalid .signbox { border-color: var(--err); background: #fff1f0; }
.minor { border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px 2px; margin: 10px 0; background: #fafafa; }
.minor .remove, .idprev .remove { background: none; border: 0; color: var(--err); font: inherit; padding: 6px 0 10px; cursor: pointer; text-decoration: underline; }
.idprev img { max-width: 100%; max-height: 260px; border-radius: 6px; margin-top: 8px; display: block; }
.note { background: #f1f1f1; border-radius: 6px; padding: 10px 12px; font-size: 15px; }
hr { border: 0; border-top: 2px solid var(--line); margin: 26px 0; }

/* ---------- thank you ---------- */
.thanks { text-align: center; padding: 34px 16px; }
.thanks .tick { width: 110px; height: 110px; border-radius: 50%; background: #1f9d2b; color: #fff; font-size: 70px; line-height: 110px; margin: 0 auto 18px; }
.thanks h1 { font-size: 30px; margin: 0 0 8px; }

/* ---------- operator ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 13px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list li:active { background: #fff3c4; }
.list .who { flex: 1; font-weight: 600; }
.list .meta { color: var(--muted); font-size: 14px; font-weight: 400; display: block; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; padding: 3px 7px; border-radius: 4px; background: #eee; color: #333; white-space: nowrap; }
.tag.red { background: var(--red); color: #fff; }
.tag.green { background: #1f9d2b; color: #fff; }
.day { font-weight: 700; background: var(--black); color: var(--gold); padding: 6px 10px; border-radius: 4px; margin: 16px 0 2px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 10px; font-size: 15px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.sigview { border: 1px solid var(--line); border-radius: 6px; max-width: 100%; max-height: 180px; background: #fff; }
.idbox { border: 3px solid var(--gold); border-radius: 8px; padding: 12px; background: #fffbea; }
.idbox img { max-width: 100%; border-radius: 6px; display: block; margin: 8px 0; }
.toggle { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle input { width: 24px; height: 24px; }

/* ---------- modal (signature pad, PIN) ---------- */
#modal { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.82); display: flex; align-items: center; justify-content: center; padding: 10px; }
#modal[hidden] { display: none; }
.sheet { background: #fff; border-radius: 10px; padding: 16px; width: 100%; max-width: 760px; }
.sheet h2 { margin: 0 0 10px; font-size: 22px; }
.pad { width: 100%; aspect-ratio: 900 / 340; background: #fff; border: 2px solid var(--black); border-radius: 6px; touch-action: none; display: block; }
.sheet .actions { display: flex; gap: 10px; margin-top: 10px; }
.sheet .actions .btn { margin: 0; font-size: 19px; min-height: 52px; padding: 10px; }

@media print {
  body { background: #fff; }
  .bar, .noprint, .btn { display: none !important; }
  .card { box-shadow: none; padding: 0; }
  .wrap { max-width: none; padding: 0; }
}

.idbox { margin-bottom: 18px; }

.hero .logo { background: #fff; border-radius: 12px; padding: 14px 16px; max-width: 520px; margin: 0 auto; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.hero .logo img { display: block; width: 100%; height: auto; }

.guardian { font-weight: 700; background: #fff3c4; border-left: 5px solid var(--gold); padding: 10px 12px; margin: 18px 0; }
.doc .guardian-stmt { display: none; }   /* stored with the record; displayed above the signature instead */
