/* ============================================
   MODALE FORGOT PASSWORD
   ============================================ */

/* Desktop uniquement */
@media (min-width: 769px) {
    /* Modale Forgot Password */
    #forgotPasswordModal {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) scale(0.98);
        width: 90%;
        max-width: 520px;
        max-height: 85vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-radius: 24px;
        box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3);
        z-index: 10001 !important;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.2s;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        pointer-events: none;
    }
    
    #forgotPasswordModal.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translate(-50%, -50%) scale(1);
        transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0s;
    }
    
    /* Bouton fermer */
    #forgotPasswordModal .modal__close,
    #forgotPasswordModal #closeForgotPasswordModal {
        position: absolute !important;
        top: 20px !important;
        right: 20px !important;
        width: 44px !important;
        height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(184, 70, 31, 0.08) !important;
        border: none !important;
        border-radius: 12px !important;
        color: #B8461F !important;
        font-size: 24px !important;
        font-weight: 400 !important;
        line-height: 1 !important;
        cursor: pointer !important;
        z-index: 100 !important;
        transition: all 0.2s ease !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    #forgotPasswordModal .modal__close:hover,
    #forgotPasswordModal #closeForgotPasswordModal:hover {
        background: rgba(184, 70, 31, 0.15) !important;
        color: #9a3819 !important;
        transform: scale(1.05) !important;
    }
    
    #forgotPasswordModal .modal__close:active,
    #forgotPasswordModal #closeForgotPasswordModal:active {
        transform: scale(0.95) !important;
    }
    
    /* Contenu */
    .forgot-password-content {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 45px 35px 35px;
        opacity: 0;
        transform: translateY(10px);
        transition: opacity 0.25s ease 0.1s, transform 0.25s ease 0.1s;
    }
    
    #forgotPasswordModal.active .forgot-password-content {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Header */
    .forgot-password-header {
        text-align: center;
        margin-bottom: 30px;
    }
    
    .forgot-password-icon {
        width: 70px;
        height: 70px;
        margin: 0 auto 20px;
        background: linear-gradient(135deg, #B8461F 0%, #9a3819 100%);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 32px;
        color: white;
        box-shadow: 0 8px 20px rgba(184, 70, 31, 0.3);
    }
    
    .forgot-password-title {
        font-size: 24px;
        font-weight: 700;
        color: #1a1a1a;
        margin: 0 0 10px;
    }
    
    .forgot-password-subtitle {
        font-size: 14px;
        color: #6b7280;
        line-height: 1.6;
        margin: 0;
    }
    
    /* Formulaires */
    .forgot-password-form {
        display: none;
    }
    
    .forgot-password-form.active {
        display: block;
        animation: fadeInForm 0.3s ease;
    }
    
    @keyframes fadeInForm {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Success message */
    .forgot-password-success {
        text-align: center;
        padding: 20px 0;
    }
    
    .forgot-password-success-icon {
        width: 80px;
        height: 80px;
        margin: 0 auto 20px;
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 40px;
        color: white;
        animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    
    @keyframes successPop {
        0% {
            transform: scale(0);
        }
        50% {
            transform: scale(1.1);
        }
        100% {
            transform: scale(1);
        }
    }
    
    .forgot-password-success-title {
        font-size: 22px;
        font-weight: 700;
        color: #1a1a1a;
        margin: 0 0 12px;
    }
    
    .forgot-password-success-text {
        font-size: 15px;
        color: #6b7280;
        line-height: 1.6;
        margin: 0 0 25px;
    }
    
    /* Back link */
    .forgot-password-back {
        text-align: center;
        margin-top: 20px;
    }
    
    .forgot-password-back-link {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: #B8461F;
        text-decoration: none;
        font-size: 14px;
        font-weight: 600;
        transition: all 0.2s ease;
    }
    
    .forgot-password-back-link:hover {
        color: #9a3819;
        gap: 12px;
    }
    
    .forgot-password-back-link i {
        font-size: 12px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Overlay mobile */
    #forgotPasswordOverlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(0, 0, 0, 0.6) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        z-index: 9999 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: opacity 0.3s ease, visibility 0s 0.3s;
        pointer-events: none !important;
        display: none !important;
    }
    
    #forgotPasswordOverlay.active {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        display: block !important;
        transition: opacity 0.3s ease, visibility 0s 0s;
    }
    
    /* Modale mobile - Bottom sheet */
    #forgotPasswordModal {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 90vh !important;
        background: white !important;
        border-radius: 24px 24px 0 0 !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2) !important;
        z-index: 10001 !important;
        transform: translateY(100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }
    
    #forgotPasswordModal.active {
        transform: translateY(0) !important;
    }
    
    /* Handle de glissement */
    #forgotPasswordModal::before {
        content: '' !important;
        position: absolute !important;
        top: 12px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 40px !important;
        height: 4px !important;
        background: rgba(0, 0, 0, 0.2) !important;
        border-radius: 2px !important;
        z-index: 1 !important;
    }
    
    /* Bouton fermer mobile */
    #forgotPasswordModal .modal__close,
    #forgotPasswordModal #closeForgotPasswordModal {
        position: absolute !important;
        top: 16px !important;
        right: 16px !important;
        width: 36px !important;
        height: 36px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(184, 70, 31, 0.08) !important;
        border: none !important;
        border-radius: 10px !important;
        color: #B8461F !important;
        font-size: 20px !important;
        cursor: pointer !important;
        z-index: 100 !important;
        transition: all 0.2s ease !important;
    }
    
    /* Contenu mobile */
    .forgot-password-content {
        flex: 1 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 40px 20px 30px !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Header mobile */
    .forgot-password-header {
        text-align: center;
        margin-bottom: 25px;
    }
    
    .forgot-password-icon {
        width: 60px !important;
        height: 60px !important;
        font-size: 28px !important;
        margin: 0 auto 16px !important;
    }
    
    .forgot-password-title {
        font-size: 20px !important;
        margin: 0 0 10px !important;
    }
    
    .forgot-password-subtitle {
        font-size: 14px !important;
        line-height: 1.5 !important;
        padding: 0 10px !important;
    }
    
    /* Formulaires mobile */
    .form-group {
        margin-bottom: 16px !important;
    }
    
    .form-label {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }
    
    .form-input {
        padding: 14px 16px !important;
        font-size: 16px !important;
        border-radius: 12px !important;
    }
    
    .input-with-icon .form-input {
        padding-right: 50px !important;
    }
    
    .input-icon-btn {
        width: 40px !important;
        height: 40px !important;
        right: 8px !important;
    }
    
    /* Boutons mobile */
    .btn {
        padding: 16px 24px !important;
        font-size: 16px !important;
        border-radius: 12px !important;
        font-weight: 700 !important;
    }
    
    /* Success mobile */
    .forgot-password-success-icon {
        width: 70px !important;
        height: 70px !important;
        font-size: 36px !important;
        margin: 0 auto 20px !important;
    }
    
    .forgot-password-success-title {
        font-size: 20px !important;
    }
    
    .forgot-password-success-text {
        font-size: 14px !important;
        padding: 0 10px !important;
    }
    
    /* Back link mobile */
    .forgot-password-back {
        margin-top: 20px !important;
        padding-bottom: 10px !important;
    }
    
    .forgot-password-back-link {
        font-size: 15px !important;
        padding: 12px !important;
    }
    
    /* Messages mobile */
    .auth-modal-message {
        margin: 16px 0 !important;
        padding: 14px 18px !important;
        font-size: 14px !important;
        border-radius: 12px !important;
    }
}
