* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(216, 243, 230, 0.75), rgba(255,255,255,.8) 44%, rgba(242,193,78,.18)), #f7faf8;
    color: #17221f;
    font-family: Arial, sans-serif;
}

a {
    color: #1f7a5b;
    font-weight: 700;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.card {
    background: #fff;
    border: 1px solid #d8e7de;
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(23,34,31,.12);
}

.auth-card {
    width: min(100%, 430px);
    padding: 30px;
}

.topbar {
    background: rgba(255,255,255,.9);
    border-bottom: 1px solid #d8e7de;
}

.topbar-inner {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    font-size: 20px;
    font-weight: 900;
    color: #17221f;
}

.muted {
    color: #60716b;
}

.eyebrow {
    margin: 0;
    color: #1f7a5b;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

h1 {
    margin: 8px 0 0;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.05;
}

h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.15;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 800;
}

input,
textarea {
    width: 100%;
    border: 1px solid #cad8d1;
    border-radius: 6px;
    padding: 13px 12px;
    color: #17221f;
    font: inherit;
    outline: none;
}

input:focus,
textarea:focus {
    border-color: #1f7a5b;
    box-shadow: 0 0 0 3px #d8f3e6;
}

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

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

.full {
    grid-column: 1 / -1;
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 11px 16px;
    background: #1f7a5b;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.button:hover {
    background: #176247;
    text-decoration: none;
}

.button.secondary {
    background: #fff;
    border-color: #cad8d1;
    color: #17221f;
}

.button.secondary:hover {
    border-color: #1f7a5b;
    color: #1f7a5b;
}

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

.alert.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert.success {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.page-head {
    padding: 32px 0 24px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.events {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding-bottom: 40px;
}

.event-card {
    padding: 20px;
}

.event-meta {
    margin: 12px 0 24px;
    line-height: 1.6;
}

.ratio {
    font-size: 30px;
    font-weight: 900;
}

.actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel {
    padding: 24px;
}

.ticket {
    width: min(100%, 540px);
    margin: 32px auto;
    padding: 28px;
    text-align: center;
}

.detail-box {
    margin-top: 24px;
    padding: 18px;
    background: rgba(216,243,230,.6);
    border-radius: 6px;
    text-align: left;
}

.qr-box {
    width: 270px;
    height: 270px;
    margin: 24px auto 0;
    display: grid;
    place-items: center;
    background: #f7faf8;
    border: 1px solid #d8e7de;
    border-radius: 8px;
}

.scan-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
}

#reader {
    min-height: 320px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #cad8d1;
    background: #000;
}

.status {
    min-height: 240px;
    padding: 22px;
    border-radius: 8px;
    background: #17221f;
    color: #fff;
    transition: background .2s ease;
}

.status.success {
    background: #16a34a;
}

.status.duplicate {
    background: #f2c14e;
    color: #17221f;
}

.status.invalid,
.status.error {
    background: #dc2626;
}

.status-message {
    font-size: 28px;
    line-height: 1.12;
    font-weight: 900;
}

@media (max-width: 860px) {
    .two,
    .events,
    .scan-grid {
        grid-template-columns: 1fr;
    }

    .page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-inner {
        height: auto;
        min-height: 68px;
        flex-wrap: wrap;
    }
}
