/**
 * Styles pour le modal de connexion
 * Structure organisée par sections et responsive
 */

/* ===== 1. STYLES GÉNÉRAUX ===== */

/* Structure de base des modaux */
.modal-header {
    background-color: var(--primary-color);
    color: white;
    border-bottom: none;
    padding: 15px 20px;
    border-top-left-radius: 0.3rem;
    
    border-top-right-radius: 0.3rem;
}
}

.modal-title {
    font-weight: 600;
    font-size: 1.2rem;
}

.modal-body {
    padding: 0, 1rem;
}

.modal-footer {
    border-top: 1px solid #eee;
    padding: 10px 20px;
}

/* Animation du modal */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translateY(-20px);
}

.modal.show .modal-dialog {
    transform: translateY(0);
}

/* ===== 2. STYLES DES ONGLETS ===== */

/* Structure des onglets */
#authTabs {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem !important;
    margin-top: 1rem;
    padding: 0 15px;
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    --bs-nav-tabs-border-width: var(--bs-border-width);
    --bs-nav-tabs-border-color: var(--border-color);
    --bs-nav-tabs-border-radius: var(--bs-border-radius);
    --bs-nav-tabs-link-hover-border-color: var(--bs-secondary-bg);
}

/* Style des items d'onglet */
#authTabs .nav-item {
    padding: 0;
    margin: 0;
    width: 50%;
}

/* Style des liens d'onglet */
#authTabs .nav-link {
    border: none;
    color: var(--primary-color);
    padding: 12px 0;
    transition: var(--transition);
    font-weight: 500;
    font-size: 1rem;
    border-radius: 0;
    background-color: #fff;
    width: 100%;
    text-align: center;
    margin-bottom: -1px; /* Pour que l'onglet actif cache la bordure inférieure */
}

/* Style de l'onglet actif */
#authTabs .nav-link.active {
    color: #fff;
    background-color: var(--primary-color);
    border: none;
}

/* Style des coins arrondis des onglets */
#authTabs .nav-item:first-child .nav-link {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

#authTabs .nav-item:last-child .nav-link {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

/* Style du contenu des onglets */
.tab-content {
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 0 0 0.5rem 0.5rem;
}

/* ===== 3. STYLES SPÉCIFIQUES AU MODAL DE CONNEXION ===== */

/* Structure du modal */
#loginModal .modal-header {
    border-radius: 0;
}

#loginModal .modal-content {
    border-radius: 0.5rem;
    overflow: hidden;
}

/* Styles des onglets spécifiques au modal */
#loginModal .nav-tabs .nav-link {
    color: white;
    font-weight: 500;
    border: none;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
    background-color: var(--primary-color);
}

#loginModal .nav-tabs .nav-link.active {
    color: var(--gray-color);
    border-bottom: 1px solid #495057;
    background-color: transparent;
}

#loginModal .nav-tabs .nav-link:hover:not(.active) {
    border-bottom: 2px solid #dee2e6;
}

/* Styles des formulaires */
#loginModal .form-floating label {
    color: #6c757d;
}

#loginModal .form-check-label {
    font-size: 0.9rem;
}

#loginModal .form-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Styles des boutons */
#loginModal .btn-primary {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

#loginModal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Styles des liens et éléments interactifs */
.text-decoration-none {
    color: var(--redcolor);
}

#rememberMe {
    color: var(--primary-color);
}

/* Style des cases à cocher */
#rememberMe:checked, #termsCheck:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check {
    display: flex;
    min-height: 1.5rem;
    padding-left: 1.5em;
    margin-bottom: 1rem;
}

/* ===== 4. STYLES RESPONSIFS ===== */

/* Styles responsifs pour les appareils mobiles */
@media (max-width: 576px) {
    /* Structure générale du modal - approche plein écran */
    .modal-dialog,
    #loginModal .modal-dialog {
        margin: 0;
        max-width: 100%;
        width: 100%;
        height: auto;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .modal-content,
    #loginModal .modal-content {
        height: 100%;
        border-radius: 0;
        border: none;
        box-shadow: none;
        width: 100vw;
        max-width: 100vw;
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
    }
    
    /* En-tête du modal */
    .modal-header,
    #loginModal .modal-header {
        padding: 12px 15px;
        background-color: var(--primary-color);
        border-bottom: none;
        color: white;
        flex-shrink: 0;
    }
    
    #loginModal {
        padding: 0 !important;
    }
    
    #loginModal .modal-title {
        font-size: 1.2rem;
        font-weight: 600;
        margin: 0;
        text-align: left;
    }
    
    #loginModal .btn-close {
        background-color: transparent;
        filter: invert(1) grayscale(100%) brightness(200%);
    }
    
    /* Corps du modal */
    .modal-body,
    #loginModal .modal-body {
        padding: 0;
        flex: 1;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
    
    /* Style des onglets sur mobile */
    #authTabs {
        margin-top: 1rem;
        padding: 0 15px;
        border-bottom: 1px solid var(--border-color);
    }
    
    #authTabs .nav-item {
        width: 50%;
    }
    
    #authTabs .nav-link {
        padding: 12px 0;
        font-size: 0.9rem;
        border-radius: 0 !important; /* Suppression des coins arrondis sur mobile */
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* Contenu des onglets */
    .tab-content,
    #loginModal .tab-content {
        padding: 1rem;
        border-radius: 0;
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }
    
    /* Ajustements pour les formulaires sur mobile */
    .form-floating {
        margin-bottom: 15px;
    }
    
    .form-control {
        font-size: 16px; /* Évite le zoom automatique sur iOS */
        box-sizing: border-box;
    }
    /* Style des coins arrondis des onglets */
    #authTabs .nav-item:first-child .nav-link {
        border-top-left-radius: 8px !important;
        border-top-right-radius: 8px !important;
    }

    #authTabs .nav-item:last-child .nav-link {
        border-top-left-radius: 8px !important;
        border-top-right-radius: 8px !important;
    }
    /* Formulaires sur mobile */
    #loginModal .form-group {
        margin-bottom: 1rem;
    }
    
    #loginModal label {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }
    
    #loginModal .form-control {
        padding: 0.5rem;
        font-size: 16px; /* Maintenir la taille pour éviter le zoom iOS */
        border-radius: 6px;
    }
    
    /* Champs côte à côte sur mobile */
    #loginModal .row {
        margin: 0 -0.25rem;
    }
    
    #loginModal .row > div {
        padding: 0 0.25rem;
    }
    
    /* Textes d'aide sur mobile */
    #loginModal .form-text {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }
    
    /* Cases à cocher sur mobile */
    #loginModal .form-check {
        margin: 1rem 0;
        padding-left: 1.75rem;
    }
    
    #loginModal .form-check-input {
        margin-left: -1.75rem;
        width: 1.25rem;
        height: 1.25rem;
    }
    
    #loginModal .form-check-label {
        font-size: 0.85rem;
        padding-top: 0.15rem;
    }
    
    /* Liens sur mobile */
    #loginModal a.text-decoration-none {
        font-size: 0.85rem;
        padding: 0.4rem 0;
    }
    
    /* Boutons sur mobile */
    #loginModal .btn {
        border-radius: 6px;
        padding: 0.75rem;
        font-size: 0.95rem;
        margin-top: 0.75rem;
    }
    
    /* Animation d'ouverture et alertes */
    .modal.fade .modal-dialog {
        transform: translateY(100%);
        transition: transform 0.3s ease-out;
    }
    
    .modal.show .modal-dialog {
        transform: translateY(0);
    }
    
    #loginModal .alert {
        border-radius: 6px;
        padding: 0.6rem;
        margin-bottom: 1rem;
        font-size: 0.85rem;
    }
}
