/* --- PAGE DE CONNEXION --- */

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 20px;
}

.login-container h1 {
    color: #fff;
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.2em;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.login-container form {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    animation: slideIn 0.5s ease-out;
}

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

.login-container label {
    display: block;
    margin-top: 20px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 1em;
    letter-spacing: 0.3px;
}

.login-container label:first-of-type {
    margin-top: 0;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    background: #f7fafc;
    transition: all 0.3s ease;
    box-sizing: border-box;
    color: #2d3748;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.login-container input[type="text"]:focus,
.login-container input[type="password"]:focus {
    background: #fff;
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-container input[type="text"]::placeholder,
.login-container input[type="password"]::placeholder {
    color: #a0aec0;
}

.login-container button {
    width: 100%;
    margin-top: 30px;
    padding: 14px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-appearance: none;
    appearance: none;
    user-select: none;
}

.login-container button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.login-container button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

/* Message d'erreur */
.login-container ~ body::before {
    display: none;
}

body > :not(.login-container) {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 20px;
    font-weight: 500;
    text-align: center;
    animation: shake 0.5s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
    .login-container {
        padding: 15px;
    }
    
    .login-container form {
        padding: 40px 30px;
        max-width: 95%;
    }
}

@media (max-width: 600px) {
    .login-container {
        padding: 10px;
        justify-content: flex-start;
        padding-top: 10vh;
    }
    
    .login-container form {
        padding: 32px 20px;
        max-width: 90%;
        margin: 0 10px;
    }

    .login-container h1 {
        font-size: 1.8em;
        margin-bottom: 25px;
    }

    .login-container label {
        margin-top: 18px;
        font-size: 0.95em;
    }

    .login-container button {
        margin-top: 25px;
        padding: 16px 0;
        font-size: 1.05em;
        min-height: 48px; /* Taille minimale pour toucher facilement */
    }

    .login-container input[type="text"],
    .login-container input[type="password"] {
        padding: 14px 16px;
        font-size: 16px; /* Évite le zoom sur mobile */
        min-height: 48px;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 5px;
        padding-top: 5vh;
    }
    
    .login-container form {
        padding: 25px 15px;
        margin: 0 5px;
    }
    
    .login-container h1 {
        font-size: 1.6em;
        margin-bottom: 20px;
    }
    
    .login-container label {
        margin-top: 15px;
        font-size: 0.9em;
    }
    
    .login-container input[type="text"],
    .login-container input[type="password"] {
        padding: 12px 14px;
        font-size: 16px;
    }
    
    .login-container button {
        padding: 14px 0;
        font-size: 1em;
    }
}

@media (max-height: 700px) and (orientation: landscape) {
    .login-container {
        padding-top: 2vh;
        justify-content: center;
    }
    
    .login-container h1 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
    
    .login-container form {
        padding: 20px 25px;
    }
    
    .login-container label {
        margin-top: 12px;
        margin-bottom: 5px;
    }
    
    .login-container button {
        margin-top: 15px;
        padding: 12px 0;
    }
}
