:root {
    --bg: #f4efe4;
    --panel: #ffffff;
    --text: #111827;
    --muted: #6c6252;
    --line: #e2d2ad;
    --navy: #071d3a;
    --navy-2: #0b2b55;
    --gold: #d6a23a;
    --gold-2: #b8841e;
    --gold-soft: #fff4d8;
    --cream: #fbf7ec;
    --green: #157f3b;
    --green-bg: #e8f7ee;
    --green-border: #22a456;
    --yellow: #9a6500;
    --yellow-bg: #fff4ca;
    --yellow-border: #c18413;
    --red: #a51d1d;
    --red-bg: #fff0eb;
    --red-border: #d1392f;
    font-family: Arial, Helvetica, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 50% -180px, rgba(214, 162, 58, 0.28), transparent 340px),
        linear-gradient(180deg, #f8f0dc 0, #f4efe4 360px, #f6f2e9 100%),
        var(--bg);
    color: var(--text);
}

a {
    color: inherit;
}

.login-page {
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding: 18px;
}

.login-shell,
.app-shell {
    width: min(100%, 720px);
    margin: 0 auto;
}

.panel,
.result-card,
.scanner-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(7, 29, 58, 0.1);
}

.login-card {
    padding: 24px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-lockup-center {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.brand-logo {
    width: 92px;
    height: 98px;
    object-fit: contain;
}

.brand-logo-small {
    width: 58px;
    height: 62px;
    flex: 0 0 auto;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--gold-2);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: 1.6rem;
    line-height: 1.15;
    color: var(--navy);
}

.login-form {
    display: grid;
    gap: 18px;
    margin-top: 26px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.92rem;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 13px;
    color: var(--text);
    font: inherit;
    background: #fff;
}

select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 13px;
    color: var(--text);
    font: inherit;
    background: #fff;
}

input:focus,
select:focus,
button:focus,
a:focus {
    outline: 3px solid rgba(214, 162, 58, 0.44);
    outline-offset: 2px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    padding: 12px 18px;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(180deg, #f1c96f, var(--gold));
    color: #061a34;
    border: 1px solid #ad7b1c;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #ffd984, #c89227);
}

.btn-secondary {
    background: var(--navy);
    color: #fff;
}

.btn-ghost {
    background: #fff;
    color: var(--navy);
    border: 1px solid var(--line);
}

.btn-large {
    width: 100%;
    min-height: 74px;
    font-size: 1.25rem;
    box-shadow: 0 14px 28px rgba(143, 96, 12, 0.22);
}

.btn-row {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.topbar {
    width: min(100%, 960px);
    margin: 0 auto;
    padding: 14px 16px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid rgba(214, 162, 58, 0.22);
}

.app-shell {
    padding: 12px 16px 32px;
}

.scanner-actions {
    display: grid;
    gap: 10px;
}

.admin-shortcut {
    margin-bottom: 14px;
}

.form-panel {
    padding: 18px;
    margin-bottom: 16px;
}

.form-panel h2 {
    margin: 0 0 14px;
    font-size: 1.2rem;
}

.admin-form {
    display: grid;
    gap: 14px;
}

.progress-shell {
    width: 100%;
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.12);
    border: 1px solid rgba(17, 17, 17, 0.12);
}

.progress-bar {
    height: 100%;
    background: var(--gold);
    transition: width 0.2s ease;
}

.scanner-panel {
    margin-top: 16px;
    padding: 10px;
    overflow: hidden;
    border-top: 5px solid var(--gold);
    background: #fffdf7;
}

#reader {
    width: 100%;
    min-height: 280px;
    overflow: hidden;
    border-radius: 6px;
}

#reader video {
    object-fit: cover;
}

.hidden {
    display: none;
}

.muted {
    color: var(--muted);
    margin: 0;
    min-height: 22px;
}

.session-label {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.result-area {
    margin-top: 18px;
}

.result-card {
    padding: 18px;
    border-left: 8px solid var(--gold);
}

.result-card h2 {
    margin: 8px 0 10px;
    font-size: 1.35rem;
}

.result-card.success {
    background: var(--green-bg);
    border-left-color: var(--green-border);
}

.result-card.warning {
    background: var(--yellow-bg);
    border-left-color: var(--yellow-border);
}

.result-card.error {
    background: var(--red-bg);
    border-left-color: var(--red-border);
}

.result-card.info {
    background: var(--gold-soft);
}

.result-summary {
    margin: 0 0 14px;
    color: #2f2a1f;
    font-size: 1rem;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.result-card.success .result-badge {
    background: var(--green);
}

.result-card.warning .result-badge {
    background: var(--yellow);
}

.result-card.error .result-badge {
    background: var(--red);
}

.result-card.info .result-badge {
    background: var(--navy);
}

.details {
    display: grid;
    gap: 0;
    margin: 0;
}

.details div {
    display: grid;
    grid-template-columns: 118px 1fr;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(7, 29, 58, 0.1);
}

.details dt {
    color: var(--navy);
    font-weight: 800;
}

.details dd {
    margin: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.result-card.warning .details dt {
    color: #76500a;
}

.result-card.error .details dt {
    color: #8b1a1a;
}

.alert {
    border-radius: 8px;
    padding: 12px;
    font-weight: 700;
}

.alert-error {
    color: var(--red);
    background: var(--red-bg);
}

.alert-warning {
    color: var(--yellow);
    background: var(--yellow-bg);
    margin-bottom: 16px;
}

@media (max-width: 560px) {
    .login-page {
        align-items: start;
        padding-top: 28px;
    }

    .login-card {
        padding: 22px 18px;
    }

    .brand-logo {
        width: 82px;
        height: 88px;
    }

    .topbar {
        align-items: center;
        gap: 10px;
    }

    .topbar h1 {
        font-size: 1.22rem;
    }

    .topbar .btn {
        min-height: 38px;
        padding: 8px 10px;
        font-size: 0.86rem;
        white-space: nowrap;
    }

    .brand-lockup {
        gap: 10px;
        min-width: 0;
    }

    .brand-logo-small {
        width: 46px;
        height: 50px;
    }

    .app-shell {
        padding: 10px 14px 28px;
    }

    .details div {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}
