/* Page de connexion moderne - LEADEUR SUD */

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Animation de fond */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.particle:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 40%;
    left: 80%;
    animation-delay: 4s;
}

.particle:nth-child(4) {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 20%;
    animation-delay: 1s;
}

.particle:nth-child(5) {
    width: 90px;
    height: 90px;
    top: 10%;
    right: 30%;
    animation-delay: 3s;
}

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

/* Container principal */
.login-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 40px;
    animation: slideInDown 0.8s ease-out;
}

.login-header .logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.login-header .logo:hover {
    transform: scale(1.05);
}

.login-header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.login-header .subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Formulaire */
.login-form {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: slideInUp 0.8s ease-out 0.2s both;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-label {
    display: flex;
    align-items: center;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-label i {
    margin-right: 8px;
    color: #667eea;
    font-size: 1.1rem;
}

.form-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    color: #333;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.form-input::placeholder {
    color: #999;
    font-style: italic;
}

/* Bouton de connexion */
.login-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.button-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.login-button.loading .button-text {
    opacity: 0;
}

.login-button.loading .button-loader {
    display: block;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Options de connexion */
.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

.remember-me input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.remember-me input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.remember-me input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.forgot-password {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 30px;
    animation: slideInUp 0.8s ease-out 0.4s both;
}

.login-footer p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.security-info {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

.security-info i {
    margin-right: 5px;
    color: #4CAF50;
}

/* Messages */
#message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
}

.message.error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336;
}

.message.success {
    background: #e8f5e8;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.message.info {
    background: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #2196f3;
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media screen and (max-width: 768px) {
    .login-container {
        padding: 15px;
    }
    
    .login-form {
        padding: 30px 25px;
        max-width: 100%;
    }
    
    .login-header h1 {
        font-size: 2rem;
    }
    
    .login-header .subtitle {
        font-size: 1rem;
    }
    
    .form-input {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    .login-button {
        padding: 12px;
        font-size: 1rem;
    }
    
    .login-options {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

@media screen and (max-width: 480px) {
    .login-form {
        padding: 25px 20px;
        border-radius: 15px;
    }
    
    .login-header h1 {
        font-size: 1.8rem;
    }
    
    .login-header .logo {
        width: 60px;
        height: 60px;
    }
    
    .form-input {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .login-button {
        padding: 10px;
        font-size: 0.95rem;
    }
    
    #message-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .message {
        max-width: none;
    }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    .login-form {
        background: rgba(30, 30, 30, 0.95);
        color: white;
    }
    
    .form-label {
        color: white;
    }
    
    .form-input {
        background: rgba(50, 50, 50, 0.8);
        color: white;
        border-color: #444;
    }
    
    .form-input:focus {
        border-color: #667eea;
        background: rgba(50, 50, 50, 1);
    }
    
    .remember-me {
        color: #ccc;
    }
}

/* Améliorations d'accessibilité */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible pour l'accessibilité */
.form-input:focus,
.login-button:focus,
.remember-me:focus-within,
.forgot-password:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Amélioration du contraste */
@media (prefers-contrast: high) {
    .form-input {
        border-color: #000;
    }
    
    .login-button {
        background: #000;
        color: #fff;
    }
    
    .form-label {
        color: #000;
    }
}
