/* ==========================================================================
   Pyrokinesis Gate Pass (event name and year come from config brand)
   Two themes share one set of tokens:
   - .theme-fire  : public pages + staff login (dark, ember glow)
   - .theme-admin : staff pages (light, readable) with a dark branded header
   Fonts are self-hosted (SIL OFL) so gates work offline.
   ========================================================================== */

@font-face { font-family: 'Bebas Neue'; src: url('fonts/BebasNeue-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('fonts/Poppins-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('fonts/Poppins-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('fonts/Poppins-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('fonts/Poppins-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
    --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --display: 'Bebas Neue', 'Poppins', Impact, sans-serif;

    --flame-1: #ffd43b;   /* yellow core */
    --flame-2: #ff922b;   /* orange */
    --flame-3: #f76707;   /* deep orange */
    --flame-4: #e03131;   /* red */
    --flame: linear-gradient(135deg, var(--flame-2) 0%, var(--flame-3) 45%, var(--flame-4) 100%);
    --flame-text: linear-gradient(180deg, var(--flame-1) 0%, var(--flame-2) 45%, var(--flame-4) 100%);

    --night: #140d0c;
    --ok: #2f9e44;
    --bad: #e03131;
    --warn: #f08c00;
    --radius: 14px;

    /* light (admin) defaults */
    --bg: #f8f4f1;
    --card: #ffffff;
    --text: #221a18;
    --muted: #7a6a65;
    --border: #eadfda;
    --accent: #e8590c;
    --input-bg: #fff;
    --shadow: 0 1px 2px rgba(60, 30, 20, .06), 0 6px 24px rgba(60, 30, 20, .06);
}

.theme-fire {
    --bg: #0d0909;
    --card: rgba(255, 255, 255, .045);
    --text: #f8eee9;
    --muted: #b3a19b;
    --border: rgba(255, 255, 255, .10);
    --accent: #ff922b;
    --input-bg: rgba(255, 255, 255, .06);
    --shadow: 0 10px 40px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }
.theme-fire {
    background:
        radial-gradient(900px 500px at 50% -120px, rgba(247, 103, 7, .38), transparent 70%),
        radial-gradient(600px 400px at 100% 0%, rgba(224, 49, 49, .18), transparent 70%),
        radial-gradient(500px 400px at 0% 10%, rgba(255, 146, 43, .12), transparent 70%),
        var(--bg);
    background-attachment: fixed;
}
a { color: var(--accent); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .5rem; font-weight: 700; }
h2 { font-size: 1.1rem; margin: 28px 0 10px; font-weight: 600; }
.container { max-width: 1040px; margin: 0 auto; padding: 24px 16px 48px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.left { text-align: left; }
.mono { font-family: ui-monospace, Consolas, monospace; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: rgba(127, 127, 127, .12); padding: 1px 5px; border-radius: 4px; }

/* ---- Header ---- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 20px; background: var(--night); color: #f8eee9;
    border-bottom: 1px solid rgba(255, 146, 43, .25); box-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.theme-fire .topbar { background: rgba(13, 9, 9, .6); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-crest { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 0 6px rgba(255, 146, 43, .35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-event { font-family: var(--display); font-size: 1.55rem; letter-spacing: .06em;
    background: var(--flame-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-event b { font-weight: 400; }
.brand-sub { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #b3a19b; }
.topbar nav { display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; }
.topbar nav a { color: #f1e4de; text-decoration: none; font-weight: 500; font-size: .92rem; padding: 4px 0; border-bottom: 2px solid transparent; }
.topbar nav a:hover { border-color: var(--flame-2); }
.topbar button.link { color: var(--flame-2); }
.nav-user { color: #b3a19b; font-size: .85rem; }
.nav-role { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 99px; font-size: .7rem;
    text-transform: uppercase; letter-spacing: .05em; background: rgba(255, 146, 43, .15); color: var(--flame-2); }

.site-footer { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 24px 16px 32px;
    color: var(--muted); font-size: .8rem; }
.site-footer img { opacity: .85; }

/* ---- Hero (public) ---- */
.hero { text-align: center; padding: 18px 0 26px; }
.hero-crest { width: 92px; height: auto; filter: drop-shadow(0 0 18px rgba(255, 146, 43, .45)); }
.presents { margin: 10px 0 0; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.fire-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(3.4rem, 16vw, 6.5rem);
    letter-spacing: .04em; line-height: .95;
    background: var(--flame-text); -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 0 22px rgba(247, 103, 7, .45)); animation: flicker 4s ease-in-out infinite; }
.fire-year { display: block; font-size: .5em; letter-spacing: .5em; margin-right: -.5em; color: var(--flame-1);
    -webkit-text-fill-color: var(--flame-1); }
.hero-sub { margin: 10px 0 0; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; font-size: .85rem; }
@keyframes flicker {
    0%, 100% { filter: drop-shadow(0 0 22px rgba(247, 103, 7, .45)); }
    45% { filter: drop-shadow(0 0 30px rgba(255, 146, 43, .6)); }
    55% { filter: drop-shadow(0 0 16px rgba(224, 49, 49, .45)); }
}
@media (prefers-reduced-motion: reduce) { .fire-title { animation: none; } }

/* ---- Cards & forms ---- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.theme-fire .card { backdrop-filter: blur(6px); }
.narrow { max-width: 420px; margin: 24px auto; }
.hero + .narrow { margin-top: 0; }
label { display: block; margin-bottom: 14px; font-weight: 500; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 11px 13px; font: inherit; color: var(--text);
    background: var(--input-bg); border: 1px solid var(--border); border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 146, 43, .2); }
.theme-fire input::placeholder { color: #806f69; }
.theme-fire select option { background: #1d1413; }
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { font-weight: 500; margin-bottom: 6px; padding: 0; }
.segmented { display: flex; gap: 8px; }
label.radio { display: inline-flex; align-items: center; gap: 7px; margin: 0 18px 0 0; font-weight: 400; cursor: pointer; }
label.radio input { width: auto; margin: 0; accent-color: var(--accent); }
.segmented label.radio { flex: 1; justify-content: center; margin: 0; padding: 10px; border: 1px solid var(--border);
    border-radius: 10px; background: var(--input-bg); font-weight: 500; }
.segmented label.radio:has(input:checked) { border-color: var(--accent); background: rgba(255, 146, 43, .12); }
.field-error { display: block; margin-top: 4px; font-size: .85rem; font-weight: 400; color: #ff8787; }
.theme-admin .field-error { color: var(--bad); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.btn { display: inline-block; padding: 11px 20px; font: inherit; font-weight: 600; letter-spacing: .02em; color: #fff;
    background: var(--flame); border: 0; border-radius: 10px; cursor: pointer; text-decoration: none; text-align: center;
    box-shadow: 0 4px 14px rgba(224, 49, 49, .25); transition: transform .1s, box-shadow .15s, filter .15s; }
.btn:hover { filter: brightness(1.06); box-shadow: 0 6px 20px rgba(224, 49, 49, .35); }
.btn:active { transform: translateY(1px); }
.btn-ok { background: var(--ok); box-shadow: none; }
.btn-bad { background: var(--bad); box-shadow: none; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn-sm { padding: 5px 11px; font-size: .85rem; border-radius: 8px; }
.btn-block { display: block; width: 100%; margin-top: 8px; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
form.inline { display: inline; }

.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: #ebfbee; color: #2b8a3e; border-color: #c3fae8; }
.alert-error { background: #fff5f5; color: #c92a2a; border-color: #ffe3e3; }
.alert-info { background: #fff4e6; color: #d9480f; border-color: #ffe8cc; }
.theme-fire .alert-success { background: rgba(47, 158, 68, .15); color: #8ce99a; border-color: rgba(47, 158, 68, .35); }
.theme-fire .alert-error { background: rgba(224, 49, 49, .15); color: #ffa8a8; border-color: rgba(224, 49, 49, .35); }
.theme-fire .alert-info { background: rgba(255, 146, 43, .12); color: #ffc078; border-color: rgba(255, 146, 43, .3); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; }
.badge-pending { background: #fff4e6; color: #d9480f; }
.badge-approved { background: #ebfbee; color: #2b8a3e; }
.badge-rejected, .badge-revoked { background: #fff5f5; color: #c92a2a; }
.badge-scan-ok { background: #ebfbee; color: #2b8a3e; }
.badge-scan-denied { background: #fff5f5; color: #c92a2a; }
.badge-scan-ignored { background: #fff9db; color: #e67700; }
.theme-fire .badge-pending { background: rgba(255, 146, 43, .15); color: #ffc078; }
.theme-fire .badge-approved { background: rgba(47, 158, 68, .18); color: #8ce99a; }
.theme-fire .badge-rejected, .theme-fire .badge-revoked { background: rgba(224, 49, 49, .18); color: #ffa8a8; }
.eyebrow { margin: 0 0 4px; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

/* ---- Status / ticket (public) ---- */
.status-card h1 { margin-bottom: 2px; }
.ref { margin: 14px 0; padding: 10px 14px; background: rgba(127, 127, 127, .1); border-radius: 10px; }
.ref strong { font-size: 1.15rem; letter-spacing: .06em; }
.qr { display: block; width: 100%; max-width: 280px; margin: 8px auto; image-rendering: pixelated; }

.ticket { max-width: 400px; margin: 8px auto 0; border-radius: 22px; overflow: hidden; color: #f8eee9;
    background: linear-gradient(180deg, #2a1512 0%, #170e0d 55%, #120b0b 100%);
    border: 1px solid rgba(255, 146, 43, .35); box-shadow: 0 20px 60px rgba(0, 0, 0, .55), 0 0 40px rgba(247, 103, 7, .15); }
.ticket-head { position: relative; padding: 20px 20px 16px; text-align: center;
    background: radial-gradient(400px 160px at 50% 0%, rgba(247, 103, 7, .45), transparent 70%); }
.ticket-head img { width: 64px; height: auto; filter: drop-shadow(0 0 10px rgba(255, 146, 43, .4)); }
.ticket-college { margin-top: 4px; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: #c9b6af; }
.ticket-event { font-family: var(--display); font-size: 2.6rem; line-height: 1; letter-spacing: .05em;
    background: var(--flame-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ticket-kind { display: inline-block; margin-top: 8px; padding: 3px 14px; border-radius: 99px; font-size: .72rem;
    font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #1a0f0d; background: var(--flame-1); }
.ticket-kind.kind-faculty { background: #63e6be; }
.ticket-body { padding: 4px 22px 16px; text-align: center; }
.ticket-label { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: #9c8a84; }
.ticket-name { font-size: 1.45rem; font-weight: 700; line-height: 1.25; word-break: break-word; }
.ticket-meta { color: #c9b6af; font-size: .9rem; }
.ticket-tear { position: relative; height: 22px; margin: 0 -1px; }
.ticket-tear::before { content: ''; position: absolute; left: 22px; right: 22px; top: 10px; border-top: 2px dashed rgba(255, 255, 255, .18); }
.ticket-tear::after { content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(circle at 0 50%, var(--bg) 11px, transparent 12px), radial-gradient(circle at 100% 50%, var(--bg) 11px, transparent 12px); }
.ticket-qr { margin: 6px auto 0; width: 76%; max-width: 270px; padding: 10px; background: #fff; border-radius: 14px; }
.ticket-qr img { display: block; width: 100%; image-rendering: pixelated; }
.ticket-ref { margin-top: 12px; text-align: center; font-family: var(--display); font-size: 1.9rem; letter-spacing: .14em; }
.ticket-foot { padding: 6px 22px 22px; text-align: center; font-size: .8rem; color: #b3a19b; }
.ticket-actions { max-width: 400px; margin: 16px auto 0; }
.pass-card h1 { margin-bottom: 0; }

/* ---- Admin: layout, tables, stats ---- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.page-head > span { display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: var(--muted); box-shadow: var(--shadow); font-size: .9rem; }
.stat span { display: block; font-family: var(--display); font-size: 2.4rem; line-height: 1; letter-spacing: .03em; color: var(--text); margin-bottom: 4px; }
.stat-accent { border-color: transparent; background: var(--flame); color: rgba(255, 255, 255, .9); }
.stat-accent span { color: #fff; }
a.stat-link { text-decoration: none; }
a.stat-link:hover { border-color: var(--accent); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500; }
.tabs a.active { color: var(--text); border-color: var(--accent); }
.count { font-size: .75rem; background: var(--border); border-radius: 99px; padding: 0 7px; }
.toolbar, .bulkbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select, .bulkbar input[name=note] { width: auto; flex: 1 1 180px; margin: 0; }
.toolbar label.radio { margin: 0; }
.bulkbar { padding: 10px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: rgba(127, 127, 127, .04); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255, 146, 43, .04); }
.table input[type=checkbox] { width: auto; margin: 0; accent-color: var(--accent); }
tr.inactive td { opacity: .55; }
.actions { white-space: nowrap; }
.pager { display: flex; justify-content: center; gap: 16px; margin: 16px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 3fr 2fr; } }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 16px 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.stack > * + * { margin-top: 8px; }
.stack .btn { margin-right: 6px; }
.limit-form { margin-top: 20px; }
.inline-field { display: flex; gap: 8px; margin-top: 4px; }
.inline-field input { margin: 0; max-width: 180px; }
.inline-field select { margin: 0; width: auto; }
.filter { margin: 0 0 8px; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 7px 0; border-bottom: 1px solid var(--border); }
.row-menu summary { list-style: none; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu-body { margin-top: 8px; padding: 10px; min-width: 240px; background: var(--bg); border-radius: 10px; white-space: normal; }
.row-menu-body form + form { margin-top: 10px; }

/* ---- Staff login ---- */
.login-card { text-align: center; }
.login-card form { text-align: left; }
.login-card .hero-crest { width: 76px; }
.login-title { margin: 6px 0 0; font-family: var(--display); font-weight: 400; font-size: 2.6rem; letter-spacing: .05em; line-height: 1;
    background: var(--flame-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
