:root {
    --bg: #030303;
    --card: #0b0b0b;
    --card-2: #17100a;
    --gold: #f6d47d;
    --gold-2: #b67a24;
    --muted: rgba(255,255,255,.72);
    --border: rgba(255,207,122,.42);
    --danger: #ff7474;
    --success: #7CFFB2;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top, rgba(247,215,132,.12), transparent 34%),
        linear-gradient(180deg, #000 0%, #080604 52%, #000 100%);
}

a {
    color: var(--gold);
}

button,
input {
    font-family: inherit;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================
   Index Poster Page
============================ */
.poster-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.poster-shell {
    width: min(100%, 540px);
    margin: auto;
    text-align: center;
}

.poster-card {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 22px;
    background: #000;
    box-shadow: 0 26px 90px rgba(0,0,0,.85), 0 0 36px rgba(246,212,125,.16);
}

.poster-img {
    display: block;
    width: 100%;
    height: auto;
}

.register-hotspot {
    position: absolute;
    left: 29%;
    bottom: 22.1%;
    width: 42%;
    height: 6.7%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    cursor: pointer;
    border-radius: 12px;
    text-decoration: none;
}

.register-hotspot span {
    opacity: 0;
    pointer-events: none;
}

.register-hotspot:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.fallback-register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    min-height: 52px;
    padding: 0 34px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f7d784, #b77b26);
    color: #111;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .7px;
    text-decoration: none;
    box-shadow: 0 14px 30px rgba(183,123,38,.25);
}

/* ============================
   Serial Popup
============================ */
.serial-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.82);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.serial-modal-overlay.active {
    display: flex;
}

.serial-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 34px 26px 28px;
    border-radius: 22px;
    background:
        radial-gradient(circle at top, rgba(255,204,101,.18), transparent 38%),
        linear-gradient(145deg, #090909, #18110a);
    border: 1px solid rgba(255,207,122,.45);
    box-shadow: 0 25px 80px rgba(0,0,0,.8), 0 0 28px rgba(211,156,62,.28);
    text-align: center;
    color: #fff;
    animation: vipPopup .28s ease-out;
}

@keyframes vipPopup {
    from { transform: scale(.92) translateY(16px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.serial-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.serial-modal-close:hover {
    background: rgba(255,255,255,.18);
}

.vip-chip,
.serial-modal-badge {
    display: inline-block;
    margin-bottom: 16px;
    padding: 7px 18px;
    border-radius: 999px;
    color: #1b1206;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #f6d47d, #b67a24);
    box-shadow: 0 0 18px rgba(246,212,125,.35);
}

.serial-modal h2 {
    margin: 0 0 10px;
    font-size: 26px;
}

.serial-modal p {
    margin: 0 0 22px;
    color: var(--muted);
    line-height: 1.5;
    font-size: 14px;
}

.serial-modal input {
    width: 100%;
    height: 52px;
    border-radius: 14px;
    border: 1px solid rgba(255,207,122,.38);
    background: rgba(255,255,255,.07);
    color: #fff;
    outline: none;
    padding: 0 16px;
    font-size: 18px;
    text-align: center;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.serial-modal input::placeholder {
    color: rgba(255,255,255,.38);
}

.serial-modal input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(246,212,125,.12);
}

.serial-modal button[type="submit"],
.main-submit,
.download-btn {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #f7d784, #b77b26);
    color: #111;
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(183,123,38,.28);
}

.serial-modal button[type="submit"]:hover,
.main-submit:hover,
.download-btn:hover {
    filter: brightness(1.08);
}

.serial-modal button[type="submit"]:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.serial-message {
    margin-top: 14px;
    min-height: 22px;
    font-size: 14px;
    font-weight: 700;
}

.serial-message.success { color: var(--success); }
.serial-message.error { color: var(--danger); }

/* ============================
   Form Page
============================ */
.form-page,
.result-page,
.report-page {
    padding: 22px 14px;
}

.form-shell,
.pass-shell,
.report-shell {
    width: min(100%, 860px);
    margin: 0 auto;
}

.form-card,
.pass-card,
.error-card,
.report-shell {
    background:
        radial-gradient(circle at top, rgba(255,204,101,.12), transparent 40%),
        linear-gradient(145deg, #070707, #17100a);
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: 0 25px 90px rgba(0,0,0,.74);
}

.form-card {
    padding: clamp(22px, 5vw, 42px);
}

.brand-header,
.pass-header,
.report-header {
    text-align: center;
    margin-bottom: 28px;
}

.brand-logo,
.pass-logo,
.report-logo {
    display: block;
    width: min(260px, 70vw);
    height: auto;
    margin: 0 auto 22px;
}

.brand-header h1,
.pass-header h1,
.report-header h1 {
    margin: 0 0 10px;
    font-size: clamp(26px, 6vw, 42px);
    line-height: 1.08;
}

.brand-header p,
.pass-header p,
.event-meta {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
}

.serial-pill {
    display: inline-flex;
    gap: 7px;
    margin-top: 18px;
    padding: 12px 16px;
    border: 1px solid rgba(255,207,122,.35);
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    color: #fff;
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin: 0 0 20px;
    font-weight: 700;
}

.alert-error {
    background: rgba(255,80,80,.13);
    color: var(--danger);
    border: 1px solid rgba(255,116,116,.3);
}

.vip-form {
    display: grid;
    gap: 18px;
}

.two-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.field-group label {
    display: block;
    margin-bottom: 8px;
    color: #fff;
    font-weight: 800;
}

.field-group label span {
    color: var(--gold);
}

.field-group input {
    width: 100%;
    min-height: 54px;
    border-radius: 14px;
    border: 1px solid rgba(255,207,122,.34);
    background: rgba(255,255,255,.07);
    color: #fff;
    outline: none;
    padding: 0 15px;
    font-size: 16px;
}

.field-group input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(246,212,125,.10);
}

.field-group input::placeholder {
    color: rgba(255,255,255,.38);
}

.upload-box {
    padding: 16px;
    border-radius: 16px;
    border: 1px dashed rgba(255,207,122,.44);
    background: rgba(255,255,255,.05);
}

.upload-box input {
    border: none;
    min-height: auto;
    padding: 0;
    background: transparent;
}

.upload-box small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.main-submit {
    margin-top: 8px;
}

/* ============================
   Visitor Pass
============================ */
.pass-card {
    overflow: hidden;
    padding: clamp(20px, 4vw, 34px);
}

.pass-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(170px, 250px);
    gap: 20px;
    align-items: stretch;
    margin: 26px 0;
}

.photo-frame,
.qr-frame {
    border-radius: 22px;
    border: 1px solid rgba(255,207,122,.35);
    background: rgba(255,255,255,.06);
    overflow: hidden;
}

.photo-frame {
    min-height: 260px;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
    display: block;
}

.qr-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
}

.qr-frame img {
    width: 100%;
    max-width: 220px;
    height: auto;
    border-radius: 12px;
    background: #fff;
    padding: 6px;
}

.qr-frame small {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-weight: 700;
}

.pass-meta {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 6px 0 20px;
    color: var(--gold);
    font-weight: 900;
    letter-spacing: .7px;
}

.visitor-table-wrap,
.table-wrap {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid rgba(255,207,122,.28);
}

.visitor-table,
.report-shell table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,.04);
}

.visitor-table th,
.visitor-table td,
.report-shell th,
.report-shell td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.09);
    text-align: left;
    vertical-align: middle;
}

.visitor-table th {
    width: 38%;
    color: var(--gold);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.visitor-table td {
    color: #fff;
    font-weight: 700;
}

.pass-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 22px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    border-radius: 14px;
    border: 1px solid rgba(255,207,122,.38);
    color: #fff;
    text-decoration: none;
    font-weight: 900;
    background: rgba(255,255,255,.06);
}

.error-card {
    text-align: center;
    padding: 34px;
}

/* ============================
   Admin Report
============================ */
.report-shell {
    width: min(100%, 1180px);
    padding: 22px;
}

.report-logo {
    width: min(220px, 68vw);
}

.report-shell th {
    color: #1b1206;
    background: linear-gradient(135deg, #f7d784, #b77b26);
    white-space: nowrap;
}

.report-shell td {
    color: #fff;
    white-space: nowrap;
}

.report-shell small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

/* ============================
   Responsive
============================ */
@media (max-width: 760px) {
    .poster-page {
        padding: 0;
        align-items: flex-start;
    }

    .poster-shell {
        width: 100%;
    }

    .poster-card {
        border-radius: 0;
    }

    .fallback-register {
        display: none;
    }

    .two-columns,
    .pass-hero,
    .pass-actions {
        grid-template-columns: 1fr;
    }

    .photo-frame,
    .photo-frame img {
        min-height: 300px;
    }

    .qr-frame img {
        max-width: 210px;
    }

    .visitor-table th,
    .visitor-table td {
        display: block;
        width: 100%;
        padding: 10px 14px;
    }

    .visitor-table th {
        padding-bottom: 4px;
        border-bottom: 0;
    }

    .visitor-table td {
        padding-top: 0;
    }

    .serial-modal {
        padding: 30px 20px 24px;
        border-radius: 18px;
    }

    .serial-modal h2 {
        font-size: 22px;
    }
}

@media print {
    body {
        background: #fff !important;
        padding: 0 !important;
        color: #000;
    }

    .no-print,
    .back-link,
    .download-btn {
        display: none !important;
    }

    .pass-shell {
        width: 100%;
        margin: 0;
    }

    .pass-card {
        box-shadow: none !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: #fff !important;
        color: #000 !important;
        padding: 18px !important;
    }

    .pass-header h1,
    .pass-header p,
    .visitor-table td,
    .visitor-table th,
    .pass-meta {
        color: #000 !important;
    }

    .vip-chip {
        color: #000 !important;
        border: 1px solid #000;
        background: #fff !important;
        box-shadow: none !important;
    }

    .visitor-table-wrap,
    .photo-frame,
    .qr-frame {
        border-color: #333 !important;
    }
}
