/**
 * 2FA Styles
 * 
 * Stile für die 2FA-Challenge-Seite und OTP-Eingabe.
 * Nutzt Theme-Variablen aus sso/style.css
 */

/* OTP-Code-Eingabe (6 Boxen) */
.sso-2fa-code-boxes {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
}

.sso-2fa-code-boxes .otp-box {
    width: 48px;
    height: 56px;
    border: 2px solid var(--border-color, #dee2e6);
    border-radius: var(--border-radius, 12px);
    font-size: 24px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 600;
    text-align: center;
    background: var(--light-color, #f8f9fa);
    color: var(--dark-color, #343a40);
    transition: all 0.2s ease;
}

.sso-2fa-code-boxes .otp-box:focus {
    outline: none;
    border-color: var(--primary-color, #E91A1A);
    box-shadow: 0 0 0 3px rgba(233, 26, 26, 0.15);
    background: #fff;
}

.sso-2fa-code-boxes .otp-box.filled {
    border-color: var(--success-color, #28a745);
    background: #fff;
}

.sso-2fa-code-boxes .otp-box.error {
    border-color: var(--danger-color, #dc3545);
    animation: shake 0.5s ease;
}

/* Shake-Animation bei Fehler */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* 2FA Challenge Container */
.sso-2fa-challenge {
    max-width: 420px;
    margin: 0 auto;
    padding: var(--spacing-xl, 2rem);
}

.sso-2fa-challenge h2 {
    font-family: var(--font-heading, 'Francois One', sans-serif);
    font-size: 1.75rem;
    color: var(--dark-color, #343a40);
    margin-bottom: var(--spacing-sm, 0.5rem);
    text-align: center;
}

.sso-2fa-challenge .subtitle {
    color: var(--secondary-color, #6c757d);
    text-align: center;
    margin-bottom: var(--spacing-lg, 1.5rem);
}

/* Benutzer-Info */
.sso-2fa-user-info {
    background: var(--light-color, #f8f9fa);
    border-radius: var(--border-radius, 12px);
    padding: var(--spacing-md, 1rem);
    margin-bottom: var(--spacing-lg, 1.5rem);
    text-align: center;
}

.sso-2fa-user-info .email {
    font-weight: 600;
    color: var(--dark-color, #343a40);
}

/* Trust Device Checkbox */
.sso-2fa-trust-device {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm, 0.5rem);
    margin: var(--spacing-lg, 1.5rem) 0;
    padding: var(--spacing-md, 1rem);
    background: var(--light-color, #f8f9fa);
    border-radius: var(--border-radius, 12px);
}

.sso-2fa-trust-device input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color, #E91A1A);
}

.sso-2fa-trust-device label {
    flex: 1;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--dark-color, #343a40);
}

/* Backup-Code Link */
.sso-2fa-backup-link {
    text-align: center;
    margin-top: var(--spacing-md, 1rem);
}

.sso-2fa-backup-link a {
    color: var(--secondary-color, #6c757d);
    text-decoration: none;
    font-size: 0.9rem;
}

.sso-2fa-backup-link a:hover {
    color: var(--primary-color, #E91A1A);
    text-decoration: underline;
}

/* Backup-Code Eingabe */
.sso-2fa-backup-input {
    margin: var(--spacing-lg, 1.5rem) 0;
}

.sso-2fa-backup-input input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 2px solid var(--border-color, #dee2e6);
    border-radius: var(--border-radius, 12px);
    text-align: center;
}

.sso-2fa-backup-input input:focus {
    outline: none;
    border-color: var(--primary-color, #E91A1A);
    box-shadow: 0 0 0 3px rgba(233, 26, 26, 0.15);
}

/* Fehlermeldung */
.sso-2fa-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--border-radius, 12px);
    padding: var(--spacing-md, 1rem);
    margin-bottom: var(--spacing-md, 1rem);
    color: var(--danger-color, #dc3545);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm, 0.5rem);
}

.sso-2fa-error::before {
    content: '⚠';
    font-size: 1.2rem;
}

/* Erfolg-Animation */
.sso-2fa-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--border-radius, 12px);
    padding: var(--spacing-lg, 1.5rem);
    text-align: center;
    color: var(--success-color, #28a745);
}

.sso-2fa-success .checkmark {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--spacing-md, 1rem);
    animation: checkmark-pop 0.4s ease;
}

@keyframes checkmark-pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Zurück-Button */
.sso-2fa-back {
    display: block;
    text-align: center;
    margin-top: var(--spacing-lg, 1.5rem);
    color: var(--secondary-color, #6c757d);
    text-decoration: none;
    font-size: 0.9rem;
}

.sso-2fa-back:hover {
    color: var(--dark-color, #343a40);
}

/* Loading-State */
.sso-2fa-loading {
    opacity: 0.7;
    pointer-events: none;
}

.sso-2fa-loading .login-button::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .sso-2fa-code-boxes {
        gap: 4px;
    }
    
    .sso-2fa-code-boxes .otp-box {
        width: 40px;
        height: 48px;
        font-size: 20px;
    }
    
    .sso-2fa-challenge {
        padding: var(--spacing-md, 1rem);
    }
}

/* Admin-Bereich Styles */
.ssos-2fa-wizard {
    max-width: 600px;
}

.ssos-2fa-wizard h3 {
    margin-bottom: 10px;
    color: #1d2327;
}

.ssos-2fa-step {
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ssos-2fa-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.ssos-2fa-active {
    background: #d1fae5;
    color: #065f46;
}

.ssos-2fa-pending {
    background: #fef3c7;
    color: #92400e;
}

.ssos-2fa-none {
    background: #f3f4f6;
    color: #6b7280;
}

