/* ============================================
   PAGE D'AUTHENTIFICATION VIPLE
   Design moderne PAYSAGE avec fond et logos flottants
   OPTIMISÉE ZOOM ET PETITS ÉCRANS
   ============================================ */

/* Body et conteneur principal */
.auth-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    height: 100vh;
    overflow: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.auth-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

@media (min-width: 992px) and (max-height: 800px) {
    .auth-container {
        padding: 1rem;
        align-items: flex-start;
    }
}

/* ============================================
   BACKGROUND AVEC IMAGE
   ============================================ */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 1;
}

/* Alternative avec image de paysage */
.auth-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.unsplash.com/photo-1557683316-973673baf926?w=1920') center/cover no-repeat;
    opacity: 0.3;
}

.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.9) 0%, 
        rgba(118, 75, 162, 0.9) 50%,
        rgba(24, 24, 27, 0.95) 100%
    );
    z-index: 2;
}

/* ============================================
   LOGOS FLOTTANTS ANIMÉS
   ============================================ */
.floating-icons {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    overflow: hidden;
    pointer-events: none;
}

.float-icon {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    opacity: 0.2;
    animation: float 20s infinite ease-in-out;
    animation-delay: var(--delay);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

@media (min-width: 992px) {
    .float-icon {
        width: 70px;
        height: 70px;
        font-size: 35px;
        opacity: 0.25;
    }
}

@media (min-width: 1400px) {
    .float-icon {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }
}

.float-icon i {
    color: white;
}

/* Positions des icônes - Réparties sur tout l'écran */
.float-icon-1 {
    top: 8%;
    left: 8%;
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.float-icon-2 {
    top: 12%;
    right: 12%;
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.float-icon-3 {
    top: 55%;
    left: 5%;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.float-icon-4 {
    bottom: 10%;
    right: 10%;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.float-icon-5 {
    top: 35%;
    left: 15%;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.float-icon-6 {
    top: 70%;
    right: 18%;
    background: linear-gradient(135deg, #1abc9c, #16a085);
}

.float-icon-7 {
    bottom: 20%;
    left: 12%;
    background: linear-gradient(135deg, #34495e, #2c3e50);
}

.float-icon-8 {
    top: 20%;
    right: 45%;
    background: linear-gradient(135deg, #e67e22, #d35400);
}

/* Animation flottante */
@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(0deg);
    }
    25% {
        transform: translateY(-30px) translateX(20px) rotate(5deg);
    }
    50% {
        transform: translateY(-15px) translateX(-20px) rotate(-5deg);
    }
    75% {
        transform: translateY(-40px) translateX(15px) rotate(3deg);
    }
}

/* ============================================
   CONTENU PRINCIPAL - FLEXIBLE ET RESPONSIVE
   ============================================ */
.auth-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 500px;
    padding: 0;
}

/* Petits écrans PC ou zoom élevé */
@media (min-width: 992px) and (max-width: 1366px) {
    .auth-content {
        max-width: min(90vw, 1100px);
    }
}

/* Écrans moyens */
@media (min-width: 1367px) and (max-width: 1600px) {
    .auth-content {
        max-width: min(90vw, 1200px);
    }
}

/* Grands écrans */
@media (min-width: 1601px) {
    .auth-content {
        max-width: min(85vw, 1400px);
    }
}

.auth-box {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    width: 100%;
}

/* Sur PC, layout en 2 colonnes */
@media (min-width: 992px) {
    .auth-box {
        display: grid;
        grid-template-columns: 42% 58%;
        padding: 0;
        min-height: 600px;
        max-height: none; /* Permet à la box de grandir */
    }
}

/* Petits écrans ou fort zoom - réduire la hauteur min */
@media (min-width: 992px) and (max-height: 750px) {
    .auth-box {
        min-height: 500px;
        max-height: none;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   COLONNE GAUCHE - VISUEL (PC uniquement)
   ============================================ */
.auth-visual {
    display: none;
}

@media (min-width: 992px) {
    .auth-visual {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 2.5rem 2rem;
        position: relative;
        overflow: hidden;
    }
    
    .auth-visual::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: url('https://images.unsplash.com/photo-1557683316-973673baf926?w=1920') center/cover no-repeat;
        opacity: 0.15;
    }
    
    .auth-visual-content {
        position: relative;
        z-index: 2;
        text-align: center;
        color: white;
        max-height: 100%;
        overflow-y: auto;
    }
    
    /* Logos disposés en cercle - taille responsive */
    .auth-visual-icons {
        position: relative;
        width: 220px;
        height: 220px;
        margin: 1.5rem auto;
    }
    
    @media (min-width: 1367px) {
        .auth-visual-icons {
            width: 260px;
            height: 260px;
        }
    }
    
    @media (min-width: 1601px) {
        .auth-visual-icons {
            width: 300px;
            height: 300px;
        }
    }
    
    .auth-visual-icons .visual-icon {
        position: absolute;
        width: 55px;
        height: 55px;
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(10px);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 26px;
        color: white;
        animation: floatVisual 4s infinite ease-in-out;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    }
    
    @media (min-width: 1367px) {
        .auth-visual-icons .visual-icon {
            width: 60px;
            height: 60px;
            font-size: 28px;
        }
    }
    
    @media (min-width: 1601px) {
        .auth-visual-icons .visual-icon {
            width: 70px;
            height: 70px;
            font-size: 32px;
        }
    }
    
    .visual-icon:nth-child(1) {
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        animation-delay: 0s;
    }
    
    .visual-icon:nth-child(2) {
        top: 25%;
        right: 0;
        animation-delay: 0.5s;
    }
    
    .visual-icon:nth-child(3) {
        bottom: 25%;
        right: 0;
        animation-delay: 1s;
    }
    
    .visual-icon:nth-child(4) {
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        animation-delay: 1.5s;
    }
    
    .visual-icon:nth-child(5) {
        bottom: 25%;
        left: 0;
        animation-delay: 2s;
    }
    
    .visual-icon:nth-child(6) {
        top: 25%;
        left: 0;
        animation-delay: 2.5s;
    }
    
    @keyframes floatVisual {
        0%, 100% {
            transform: translateY(0);
        }
        50% {
            transform: translateY(-12px);
        }
    }
    
    .auth-visual h1 {
        font-size: 2.2rem;
        font-weight: 800;
        margin: 1.5rem 0 0.75rem;
        text-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    }
    
    @media (min-width: 1367px) {
        .auth-visual h1 {
            font-size: 2.5rem;
        }
    }
    
    @media (min-width: 1601px) {
        .auth-visual h1 {
            font-size: 3rem;
        }
    }
    
    .auth-visual p {
        font-size: 1.1rem;
        opacity: 0.95;
        line-height: 1.5;
        max-width: 350px;
        margin: 0 auto;
    }
    
    @media (min-width: 1367px) {
        .auth-visual p {
            font-size: 1.2rem;
        }
    }
    
    @media (min-width: 1601px) {
        .auth-visual p {
            font-size: 1.3rem;
            max-width: 400px;
        }
    }
    
    .auth-visual .features-list {
        margin-top: 2rem;
        text-align: left;
        max-width: 350px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .auth-visual .feature-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 1rem;
        padding: 0.875rem;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        border-radius: 10px;
    }
    
    .auth-visual .feature-item i {
        font-size: 1.5rem;
        opacity: 0.9;
        flex-shrink: 0;
    }
    
    @media (min-width: 1367px) {
        .auth-visual .feature-item i {
            font-size: 1.6rem;
        }
    }
    
    @media (min-width: 1601px) {
        .auth-visual .feature-item i {
            font-size: 1.8rem;
        }
    }
    
    .auth-visual .feature-item span {
        font-size: 0.95rem;
        font-weight: 500;
    }
    
    @media (min-width: 1367px) {
        .auth-visual .feature-item span {
            font-size: 1rem;
        }
    }
    
    @media (min-width: 1601px) {
        .auth-visual .feature-item span {
            font-size: 1.1rem;
        }
    }
}

/* ============================================
   COLONNE DROITE - FORMULAIRE
   ============================================ */
.auth-form-column {
    padding: 2rem 2.5rem 1rem 2.5rem; /* Moins de padding en bas */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 85vh; /* Limite la hauteur pour permettre le scroll */
}

@media (min-width: 992px) {
    .auth-form-column {
        padding: 2rem 3rem 1rem 3rem; /* Moins de padding en bas */
        justify-content: flex-start; /* Au lieu de center pour permettre scroll */
        max-height: 600px; /* Limite fixe pour PC */
    }
}

@media (min-width: 992px) and (max-height: 750px) {
    .auth-form-column {
        max-height: 500px;
        padding: 1.5rem 2.5rem 1rem 2.5rem; /* Encore moins de padding pour petits écrans */
    }
}

@media (min-width: 1367px) {
    .auth-form-column {
        padding: 2.5rem 3.5rem 1rem 3.5rem;
        max-height: 700px;
    }
}

@media (min-width: 1601px) {
    .auth-form-column {
        padding: 3rem 4rem 1.5rem 4rem;
        max-height: 800px;
    }
}

/* ============================================
   LOGO VIPLE (pour mobile)
   ============================================ */
.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
    .auth-logo {
        display: none;
    }
}

.logo-circle {
    width: 70px;
    height: 70px;
    margin: 0 auto 0.875rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.5);
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 12px 30px rgba(102, 126, 234, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 16px 40px rgba(102, 126, 234, 0.7);
        transform: scale(1.05);
    }
}

.logo-v {
    font-size: 2.2rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.auth-brand {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: #18181b;
    margin: 0 0 0.5rem 0;
}

.auth-tagline {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

/* ============================================
   MESSAGE DE BIENVENUE
   ============================================ */
.auth-welcome {
    text-align: center;
    margin-bottom: 1.25rem;    /* Réduit de 1.75rem */
    padding-bottom: 1.25rem;    /* Réduit de 1.75rem */
    border-bottom: 2px solid #f0f0f0;
}

@media (min-width: 992px) {
    .auth-welcome {
        text-align: left;
        margin-bottom: 1.5rem;    /* Réduit de 2rem */
        padding-bottom: 1.5rem;
    }
}

.auth-welcome h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #18181b;
    margin-bottom: 0.5rem;
}

@media (min-width: 992px) {
    .auth-welcome h2 {
        font-size: 1.85rem;
    }
}

@media (min-width: 1367px) {
    .auth-welcome h2 {
        font-size: 2.1rem;
    }
}

@media (min-width: 1601px) {
    .auth-welcome h2 {
        font-size: 2.5rem;
    }
}

.auth-welcome p {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
}

@media (min-width: 992px) {
    .auth-welcome p {
        font-size: 1rem;
    }
}

@media (min-width: 1367px) {
    .auth-welcome p {
        font-size: 1.05rem;
    }
}

@media (min-width: 1601px) {
    .auth-welcome p {
        font-size: 1.15rem;
    }
}

/* ============================================
   FORMULAIRE - TAILLES FLEXIBLES
   ============================================ */
.auth-form-container {
    margin-bottom: 1rem; /* Réduit de 1.5rem */
}

.auth-form-container .form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.auth-form-container .form-control {
    padding: 0.875rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    height: auto;
}

.auth-form-container .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    outline: none;
}

.auth-form-container .form-control::placeholder {
    color: #aaa;
}

.auth-form-container .mb-3 {
    margin-bottom: 0.875rem !important; /* Réduit de 1.125rem */
}

.auth-form-container .form-check {
    margin: 1.25rem 0;
    padding-left: 1.75rem;
}

.auth-form-container .form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid #e5e7eb;
    margin-top: 0.15rem;
    cursor: pointer;
}

.auth-form-container .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.auth-form-container .form-check-label {
    font-size: 0.9rem;
    color: #666;
    margin-left: 0.5rem;
    cursor: pointer;
}

/* Boutons - tailles flexibles */
.auth-form-container .btn-primary {
    width: 100%;
    padding: 0.95rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.auth-form-container .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.auth-form-container .btn-primary:active {
    transform: translateY(0);
}

.auth-form-container .btn-outline-secondary {
    width: 100%;
    padding: 0.85rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.auth-form-container .btn-outline-secondary:hover {
    border-color: #667eea;
    background: #f8f9ff;
    color: #667eea;
    transform: translateY(-2px);
}

.auth-form-container .form-text {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.5rem;
}

/* Liens dans le formulaire */
.auth-form-container a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.auth-form-container a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Messages d'erreur */
.auth-form-container .text-danger {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    color: #e74c3c;
}

.auth-form-container .alert {
    border-radius: 12px;
    border: none;
    padding: 0.875rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.auth-form-container .alert-danger {
    background: #fee;
    color: #c0392b;
}

/* ============================================
   FOOTER AUTH
   ============================================ */
.auth-footer {
    text-align: center;
    padding-top: 1.5rem;
    padding-bottom: 0.5rem; /* Ajouter padding bottom */
    border-top: 2px solid #f0f0f0;
    margin-top: auto; /* Pousse en bas */
    flex-shrink: 0;
}

.auth-footer p {
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.auth-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    flex-wrap: wrap;
    margin-bottom: 0; /* Pas de marge en bas */
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-links a:hover {
    color: #764ba2;
}

.auth-links .separator {
    color: #ccc;
    font-size: 0.75rem;
}

/* ============================================
   DIVIDER "OU"
   ============================================ */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.25rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.auth-divider span {
    padding: 0 1rem;
    color: #999;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ============================================
   RESPONSIVE ET ZOOM
   ============================================ */

/* Très petits écrans */
@media (max-width: 576px) {
    .auth-container {
        padding: 0.875rem;
    }
    
    .auth-box {
        padding: 1.75rem 1.25rem;
        border-radius: 18px;
    }
    
    .auth-form-column {
        padding: 0;
    }
    
    .logo-circle {
        width: 60px;
        height: 60px;
    }
    
    .logo-v {
        font-size: 1.9rem;
    }
    
    .auth-brand {
        font-size: 1.5rem;
    }
    
    .auth-welcome h2 {
        font-size: 1.35rem;
    }
    
    .float-icon {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
}

/* Tablette */
@media (min-width: 577px) and (max-width: 991px) {
    .auth-content {
        max-width: 520px;
    }
    
    .auth-box {
        padding: 2.5rem 2rem;
    }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    .auth-box {
        background: rgba(24, 24, 27, 0.95);
        color: white;
    }
    
    .auth-brand,
    .auth-welcome h2 {
        color: white;
    }
    
    .auth-welcome p,
    .auth-tagline,
    .auth-form-container .form-label {
        color: #d4d4d8;
    }
    
    .auth-form-container .form-control {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: white;
    }
    
    .auth-form-container .form-control:focus {
        background: rgba(255, 255, 255, 0.15);
        border-color: #667eea;
    }
    
    .auth-form-container .form-control::placeholder {
        color: #888;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.auth-form-container {
    animation: fadeIn 1s ease-in 0.3s backwards;
}

.auth-footer {
    animation: fadeIn 1s ease-in 0.5s backwards;
}

/* Hover sur les logos flottants */
.float-icon {
    transition: all 0.3s ease;
}

.float-icon:hover {
    opacity: 0.35;
    transform: scale(1.08);
}

/* Scrollbar personnalisée pour la colonne formulaire */
.auth-form-column::-webkit-scrollbar {
    width: 6px;
}

.auth-form-column::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.auth-form-column::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.auth-form-column::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Assurer que le contenu est scrollable si nécessaire */
@media (min-width: 992px) {
    .auth-visual-content {
        overflow-y: auto;
        max-height: 100%;
    }
    
    .auth-visual-content::-webkit-scrollbar {
        width: 6px;
    }
    
    .auth-visual-content::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 10px;
    }
    
    .auth-visual-content::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 10px;
    }
    
    .auth-visual-content::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.5);
    }
}
