/* Public result checker */

.check-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(160deg, #0f172a 0%, #1e3a8a 45%, #1e40af 100%);
    display: flex;
    flex-direction: column;
}

.check-header {
    padding: 1rem 0;
}

.check-header a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
}

.check-header a:hover {
    color: #fff;
}

.check-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem 3rem;
}

.check-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    animation: checkPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.check-card-wide {
    max-width: 460px;
}

@keyframes checkPop {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.check-card-head {
    background: linear-gradient(135deg, var(--ds-primary), var(--ds-secondary));
    color: #fff;
    padding: 1.75rem 1.5rem;
    text-align: center;
}

.check-card-head .icon-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem;
    animation: checkPulse 2s ease-in-out infinite;
}

@keyframes checkPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35); }
    50% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); }
}

.check-card-body {
    padding: 1.5rem;
}

.check-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.check-input {
    border-radius: 0.5rem;
    border: 2px solid #e2e8f0;
    padding: 0.75rem 0.85rem;
    font-size: 1.05rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.check-input:focus {
    border-color: var(--ds-secondary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.check-input.code-input {
    font-family: ui-monospace, monospace;
    font-weight: 700;
    letter-spacing: 0.2em;
    font-size: 1.15rem;
}

.check-submit {
    width: 100%;
    padding: 0.9rem;
    font-weight: 700;
    border-radius: 0.65rem;
    border: none;
    background: linear-gradient(135deg, var(--ds-secondary), var(--ds-primary));
    color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.check-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
    color: #fff;
}

.check-help-strip {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}

.check-help-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #64748b;
}

.check-help-item .bi {
    color: var(--ds-secondary);
}

/* ── Result view (full-page report) ── */

.check-result-body {
    margin: 0;
    padding: 0;
    background: #e2e8f0;
    min-height: 100vh;
}

.check-result-toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.08);
}

.check-result-toolbar-inner {
    max-width: 220mm;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.check-back-link {
    font-size: 0.8rem;
    color: #64748b;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.15rem;
}

.check-back-link:hover {
    color: var(--ds-secondary);
}

.check-student-name {
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
}

.check-result-sheet-wrap {
    max-width: 220mm;
    margin: 0 auto;
    padding: 1rem;
}

.check-result-sheet-wrap .sheet-page {
    margin-left: auto;
    margin-right: auto;
}

/* ── Print: full A4 report ── */

@media print {
    @page {
        size: A4 portrait;
        margin: 4mm;
    }

    html, body.check-result-body {
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .check-no-print,
    .check-result-toolbar {
        display: none !important;
    }

    .check-result-sheet-wrap {
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .check-result-sheet-wrap .sheet-page {
        width: 100% !important;
        max-width: none !important;
        min-height: auto !important;
        margin: 0 !important;
        box-shadow: none !important;
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    .check-result-sheet-wrap .sheet-border {
        min-height: auto !important;
    }

    .check-result-sheet-wrap .sheet-page,
    .check-result-sheet-wrap .sheet-border,
    .check-result-sheet-wrap table {
        font-size: 8pt !important;
    }
}
