.scan-page {
    min-height: 80vh;
    padding: 70px 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.scan-card {
    width: 100%;
    max-width: 620px;
    padding: 32px;
    border-radius: 22px;
    background: #111a35;
    color: #f8fafc;
    border: 1px solid rgba(167, 139, 250, .2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
}

.scan-heading {
    text-align: center;
    margin-bottom: 28px;
}

.scan-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(139, 92, 246, .18);
    color: #a78bfa;
    font-size: 30px;
    margin-bottom: 14px;
}

.scan-heading h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.scan-heading p {
    color: #b7c0d5;
    line-height: 1.6;
}

.scan-camera {
    position: relative;
    overflow: hidden;
    background: #050816;
    border-radius: 16px;
    min-height: 280px;
}


.scan-frame span {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 4px solid #a78bfa;
}

.scan-frame span:nth-child(1) {
    top: 0;
    left: 0;
    border-right: 0;
    border-bottom: 0;
}

.scan-frame span:nth-child(2) {
    top: 0;
    right: 0;
    border-left: 0;
    border-bottom: 0;
}

.scan-frame span:nth-child(3) {
    bottom: 0;
    left: 0;
    border-right: 0;
    border-top: 0;
}

.scan-frame span:nth-child(4) {
    bottom: 0;
    right: 0;
    border-left: 0;
    border-top: 0;
}

.scan-actions {
    display: flex;
    gap: 12px;
    margin: 20px 0;
}

.scan-btn {
    border: 0;
    border-radius: 10px;
    padding: 13px 18px;
    color: white;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    font-weight: 600;
    cursor: pointer;
}

.scan-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.scan-btn-outline {
    background: transparent;
    border: 1px solid #a78bfa;
}

.scan-form {
    display: grid;
    gap: 12px;
}

.scan-form label {
    font-weight: 600;
}

.scan-form input {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    background: #1d2948;
    color: white;
    border: 1px solid #465478;
    font-size: 15px;
}

.scan-message {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    padding: 18px;
    border-radius: 12px;
}

.scan-error {
    background: rgba(239, 68, 68, .13);
    color: #fca5a5;
}

.scan-success {
    background: rgba(34, 197, 94, .13);
    color: #86efac;
}

.scan-message p {
    margin: 6px 0 0;
}

html[data-theme="light"] .scan-card {
    background: #ffffff;
    color: #172033;
    border-color: #e2e8f0;
}

html[data-theme="light"] .scan-heading p {
    color: #64748b;
}

html[data-theme="light"] .scan-form input {
    background: #f8fafc;
    color: #172033;
    border-color: #cbd5e1;
}

@media (max-width: 600px) {
    .scan-page {
        padding: 30px 12px;
    }

    .scan-card {
        padding: 20px;
    }

    .scan-actions {
        flex-direction: column;
    }

    .scan-heading h1 {
        font-size: 23px;
    }

    .scan-frame {
        inset: 45px 35px 65px;
    }
}


/* Lecteur QR Code */

.scan-camera {
    position: relative;
    overflow: hidden;
    background: #050816;
    border-radius: 16px;
    padding: 15px;
    border: 1px solid rgba(167, 139, 250, 0.25);
}

#qr-reader {
    width: 100%;
    min-height: 260px;
    border: none !important;
    border-radius: 12px;
    overflow: hidden;
    color: #ffffff;
}

#qr-reader video {
    width: 100% !important;
    max-height: 360px;
    object-fit: cover;
    border-radius: 10px;
}

#scanner-status {
    text-align: center;
    color: #c4b5fd;
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
}

/* Adaptation mobile */

@media (max-width: 600px) {
    .scan-camera {
        padding: 8px;
    }

    #qr-reader {
        min-height: 220px;
    }

    #qr-reader video {
        max-height: 300px;
    }
}