/* ===============================================
   LOGIN.CSS - Page de connexion style dashboard
   Design moderne et élégant
   =============================================== */

/* ===== 1. RÉINITIALISATION ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== 2. BODY - FOND DÉGRADÉ DASHBOARD ===== */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

/* ===== 3. CONTAINER PRINCIPAL ===== */
.login-container,
.register-container {
    width: 100%;
    max-width: 450px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    padding: 3rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInUp 0.8s ease-out;
    position: relative;
}

/* ===== LIEN ADMINISTRATION ===== */
.admin-link {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.admin-link a {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.admin-link a:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
    color: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* ===== 4. ANIMATION D'ENTRÉE ===== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 5. TITRES ===== */
.login-container h1,
.register-container h1 {
    font-size: 2.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-container p {
    font-size: 1.1rem;
    color: #5a5c69;
    margin-bottom: 2rem;
    font-weight: 400;
}

.register-container h2 {
    font-size: 1.1rem;
    color: #5a5c69;
    margin-bottom: 2rem;
    font-weight: 400;
}

/* ===== 6. FORMULAIRE ===== */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 1rem 1.2rem;
    font-size: 1rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.form-group input::placeholder {
    color: #a0a6b8;
    font-weight: 400;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: #5a5c69;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* ===== 7. BOUTONS ===== */
.login-btn,
.submit-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.login-btn:hover,
.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.login-btn:active,
.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* ===== 8. LIENS ===== */
.register-link {
    display: inline-block;
    margin: 0.5rem 0;
    font-size: 0.95rem;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
}

.register-link:hover {
    color: #5a67d8;
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* ===== 9. FOOTER AVEC LOGO CO-IOT ===== */
.footer-logo {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 1s ease-out 0.5s both;
}

.footer-logo img {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    filter: brightness(1.1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* ===== 10. RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }
    
    .login-container,
    .register-container {
        padding: 2rem 1.5rem;
        border-radius: 15px;
        max-width: 95%;
    }
    
    .login-container h1,
    .register-container h1 {
        font-size: 1.8rem;
    }
    
    .footer-logo {
        bottom: 1rem;
        font-size: 0.8rem;
        padding: 0.6rem 1.2rem;
    }
    
    .footer-logo img {
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 480px) {
    .login-container,
    .register-container {
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }
    
    .login-container h1,
    .register-container h1 {
        font-size: 1.6rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }
    
    .login-btn,
    .submit-btn {
        padding: 0.9rem;
        font-size: 1rem;
    }
    
    .footer-logo {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin-top: 2rem;
    }
}

/* ===== 11. ÉTATS D'ERREUR/SUCCÈS ===== */
.error-message {
    background: linear-gradient(135deg, #e74a3b 0%, #c0392b 100%);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-weight: 500;
    animation: shake 0.5s ease-in-out;
}

.success-message {
    background: linear-gradient(135deg, #1cc88a 0%, #17a673 100%);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-weight: 500;
    animation: slideInUp 0.5s ease-out;
}

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

/* ===== 12. EFFETS INTERACTIFS ===== */
.form-group {
    position: relative;
}

.form-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.form-group input:focus + ::after {
    width: 100%;
}