/* Styles for the public form + pass. Everything is scoped under .ap-root so the admin preview can reuse it. */
.ap-root {
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --ink: #18211f;
  --muted: #56625f;
  --line: #d5dcda;
  --field: #f5f7f6;
  --danger: #b42318;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
.ap-root *, .ap-root *::before, .ap-root *::after { box-sizing: border-box; }

.ap-head h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 10px; }
.ap-meta { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.ap-meta span:not(:last-child)::after { content: "·"; margin: 0 8px; color: var(--line); }
.ap-meta span:first-child { color: var(--accent); font-weight: 600; }
.ap-intro { margin: 0 0 24px; white-space: pre-line; }

.ap-field { margin: 0 0 18px; }
.ap-label { display: block; font-weight: 600; font-size: 15px; margin: 0 0 6px; }
.ap-req { color: var(--accent); }
.ap-root input:not([type="checkbox"]), .ap-root select, .ap-root textarea {
  width: 100%; font: inherit; font-size: 16px; color: inherit;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--field);
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.ap-root textarea { resize: vertical; min-height: 84px; }
.ap-root input:focus, .ap-root select:focus, .ap-root textarea:focus {
  outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.ap-check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.ap-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.ap-help { margin: 5px 0 0; font-size: 14px; color: var(--muted); }
.ap-error { margin: 5px 0 0; font-size: 14px; color: var(--danger); font-weight: 500; }
.ap-field.has-error input, .ap-field.has-error select, .ap-field.has-error textarea { border-color: var(--danger); }
.ap-alert { margin: 0 0 16px; padding: 12px 14px; border-radius: 8px; background: #fdecea; color: var(--danger); font-size: 15px; }
.ap-alert:focus { outline: none; }
.ap-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.ap-turnstile { margin: 0 0 16px; }

.ap-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  appearance: none; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 600; font-size: 16px; padding: 13px 22px; border-radius: 8px; cursor: pointer; text-decoration: none;
  transition: filter .15s, transform .05s;
}
.ap-btn:hover { filter: brightness(1.06); }
.ap-btn:active { transform: translateY(1px); }
.ap-btn[disabled] { opacity: .6; cursor: progress; }
.ap-btn.secondary { background: transparent; color: var(--accent); }
.ap-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 2px; }

.ap-success { margin: 0 0 18px; padding: 12px 14px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 10%, #fff); font-size: 15px; }
.ap-closed { padding: 28px 0; text-align: center; color: var(--muted); }

/* ---- pass ---- */
.ap-pass {
  width: 100%; max-width: 380px; margin: 0 auto; background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 1px 2px rgb(0 0 0 / .05), 0 12px 32px rgb(0 0 0 / .09);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.ap-pass-top { background: var(--accent); color: var(--accent-ink); padding: 20px 22px 18px; }
.ap-pass-kicker { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; opacity: .8; }
.ap-pass-event { font-size: 22px; line-height: 1.2; font-weight: 700; margin-top: 4px; }
.ap-pass-when { font-size: 15px; margin-top: 4px; opacity: .92; }
.ap-pass-body { padding: 18px 22px 20px; }
.ap-pass-name { font-size: 24px; line-height: 1.2; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.ap-pass-detail { margin: 3px 0 0; color: var(--muted); font-size: 15px; }
.ap-pass-status { margin-top: 12px; }
.ap-badge {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1.5px solid currentColor;
}
.is-pending .ap-badge { color: #a15c07; background: #fff7e6; }
.is-approved .ap-badge { color: #13734a; background: #e8f7ef; }
.is-checked_in .ap-badge { color: #4b5563; background: #f1f3f4; }
.is-denied .ap-badge { color: var(--danger); background: #fdecea; }

.ap-pass-tear { position: relative; border-top: 2px dashed var(--line); margin: 18px -22px; }
.ap-pass-tear::before, .ap-pass-tear::after {
  content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--pass-bg, #eef2f1); border: 1px solid var(--line);
}
.ap-pass-tear::before { left: -12px; }
.ap-pass-tear::after { right: -12px; }
.ap-pass-qr { display: flex; justify-content: center; }
.ap-pass-qr img { width: 232px; height: 232px; image-rendering: pixelated; }
.is-pending .ap-pass-qr img { opacity: .9; }
.ap-pass-void {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  height: 232px; border: 2px dashed var(--line); border-radius: 12px; color: var(--muted); padding: 16px;
}
.ap-pass-void strong { font-size: 22px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink); }
.ap-pass-ref { margin: 12px 0 0; text-align: center; font: 600 15px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; }
.ap-pass-note { margin: 8px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.ap-pass-actions { display: flex; flex-direction: column; gap: 10px; max-width: 380px; margin: 18px auto 0; }

/* ---- page shells ---- */
html, body { margin: 0; }
body.ap-page { background: #ffffff; }
body.ap-page.standalone { background: #eef2f1; min-height: 100vh; }
.ap-wrap { max-width: 640px; margin: 0 auto; padding: 24px 20px 32px; }
body.embedded .ap-wrap { padding: 4px 2px 12px; }

@media print {
  @page { margin: 14mm; }
  body.ap-page, body.ap-page.standalone { background: #fff !important; }
  .no-print { display: none !important; }
  .ap-wrap { padding: 0; }
  .ap-pass { box-shadow: none; border-color: #999; break-inside: avoid; }
  .ap-pass-tear::before, .ap-pass-tear::after { background: #fff; }
}
