.mfa-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.mfa-dialog-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    overflow: hidden;
    animation: dialogSlideIn 0.3s ease-out;
}

@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

// Background Shapes
.dialog-background-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(30, 64, 175, 0.05);
    animation: float 8s ease-in-out infinite;

    &.shape-1 {
        width: 80px;
        height: 80px;
        top: 15%;
        right: 10%;
        animation-delay: 0s;
    }

    &.shape-2 {
        width: 60px;
        height: 60px;
        bottom: 20%;
        left: 15%;
        animation-delay: 3s;
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(180deg);
    }
}

// Dialog Content
.mfa-dialog-content {
    position: relative;
    z-index: 1;
    padding: 2rem;
}

// Header
.mfa-header {
    position: relative;
    text-align: center;
    margin-bottom: 2rem;

    .close-button {
        position: absolute;
        top: -0.5rem;
        right: -0.5rem;
        background: #f8f9fa;
        border: none;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        color: #6b7280;

        &:hover {
            background: #e5e7eb;
            color: #374151;
            transform: scale(1.1);
        }

        svg {
            width: 16px;
            height: 16px;
        }
    }

    .header-content {
        .mfa-icon {
            width: 60px;
            height: 60px;
            margin: 0 auto 1rem;
            background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #3b82f6 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            box-shadow: 0 8px 25px rgba(30, 58, 138, 0.3);

            svg {
                width: 28px;
                height: 28px;
            }
        }

        h3 {
            font-size: 1.75rem;
            font-weight: 700;
            color: #1a1a1a;
            margin: 0 0 0.5rem 0;
            letter-spacing: -0.01em;
        }

        p {
            color: #6b7280;
            font-size: 1rem;
            margin: 0;
            line-height: 1.5;
        }
    }
}

// MFA Code Section
.mfa-code-section {
    margin-bottom: 2rem;

    .code-inputs-container {
        display: flex;
        gap: 0.75rem;
        justify-content: center;
        margin-bottom: 1rem;

        .mfa-input {
            width: 50px;
            height: 50px;
            border: 2px solid #e5e7eb;
            border-radius: 12px;
            text-align: center;
            font-size: 1.5rem;
            font-weight: 600;
            color: #1a1a1a;
            background: #ffffff;
            transition: all 0.2s ease;
            outline: none;

            &:focus {
                border-color: #1e40af;
                box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
                transform: scale(1.05);
            }

            &:hover:not(:focus) {
                border-color: #d1d5db;
            }

            &::-webkit-outer-spin-button,
            &::-webkit-inner-spin-button {
                -webkit-appearance: none;
                margin: 0;
            }

            &[type="number"] {
                -moz-appearance: textfield;
            }
        }
    }

    .error-message {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        background: #fee2e2;
        color: #dc2626;
        padding: 0.75rem 1rem;
        border-radius: 12px;
        border: 1px solid #fecaca;
        font-size: 0.9rem;
        font-weight: 500;
        animation: errorShake 0.5s ease-in-out;

        .error-icon {
            width: 16px;
            height: 16px;
            flex-shrink: 0;
        }
    }
}

@keyframes errorShake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

// Actions
.mfa-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;

    .resend-button {
        flex: 1;
        height: 48px;
        border-radius: 12px;
        font-size: 0.95rem;
        font-weight: 600;
        background: #f8f9fa;
        border: 2px solid #e5e7eb;
        color: #6b7280;
        transition: all 0.3s ease;

        &:hover:not(:disabled) {
            background: #e9ecef;
            border-color: #d1d5db;
            color: #495057;
            transform: translateY(-1px);
        }

        &:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }

        .button-content {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }

        .button-icon {
            width: 16px;
            height: 16px;
        }
    }

    .verify-button {
        flex: 2;
        height: 48px;
        border-radius: 12px;
        font-size: 1rem;
        font-weight: 600;
        background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #3b82f6 100%);
        border: none;
        color: white;
        box-shadow: 0 8px 25px rgba(30, 58, 138, 0.3);
        transition: all 0.3s ease;

        &:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 12px 35px rgba(30, 58, 138, 0.4);
        }

        &:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .button-content {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }

        .button-icon {
            width: 18px;
            height: 18px;
        }
    }
}

// Help Text
.help-text {
    text-align: center;

    p {
        color: #9ca3af;
        font-size: 0.85rem;
        margin: 0;
        line-height: 1.4;
    }
}

// Mobile Responsive
@media (max-width: 480px) {
    .mfa-dialog-overlay {
        padding: 0.5rem;
    }

    .mfa-dialog-container {
        max-width: 100%;
        border-radius: 16px;
    }

    .mfa-dialog-content {
        padding: 1.5rem;
    }

    .mfa-header {
        margin-bottom: 1.5rem;

        .header-content {
            .mfa-icon {
                width: 50px;
                height: 50px;
                margin-bottom: 0.75rem;

                svg {
                    width: 24px;
                    height: 24px;
                }
            }

            h3 {
                font-size: 1.5rem;
            }

            p {
                font-size: 0.9rem;
            }
        }
    }

    .mfa-code-section {
        margin-bottom: 1.5rem;

        .code-inputs-container {
            gap: 0.5rem;

            .mfa-input {
                width: 45px;
                height: 45px;
                font-size: 1.25rem;
            }
        }
    }

    .mfa-actions {
        flex-direction: column;
        gap: 0.75rem;

        .resend-button,
        .verify-button {
            flex: 1;
            height: 44px;
        }

        .verify-button {
            order: -1;
        }
    }
}

@media (max-width: 360px) {
    .mfa-dialog-content {
        padding: 1rem;
    }

    .code-inputs-container {
        gap: 0.4rem;

        .mfa-input {
            width: 40px;
            height: 40px;
            font-size: 1.1rem;
        }
    }
}
