/* ============================================================
   STYLES SPÉCIFIQUES À INDEX.PHP - PAGE DE CONNEXION
   ============================================================ */

/* ============================================================
   CONTENEUR PRINCIPAL
   ============================================================ */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    overflow: hidden;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.5s ease-out;
}

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

/* ============================================================
   EN-TÊTE DU FORMULAIRE
   ============================================================ */

.login-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: -25px -30px 20px -30px;
    padding: 20px 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
    border-radius: 12px 12px 0 0;
}

.login-logo {
    flex-shrink: 0;
}

.login-logo img {
    max-width: 80px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.login-header-text {
    flex: 1;
    text-align: left;
    text-align: center;
}

.login-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.login-subtitle {
    font-size: 16px;
    color: #5a6c7d;
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
}

/* ============================================================
   FORMULAIRE
   ============================================================ */

.form-signin {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.4);
    margin: 0;
    max-width: 100%;
}

/* ============================================================
   ALERTES
   ============================================================ */

.login-alert-top {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: calc(100% - 40px);
    max-width: 420px;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: slideDown 0.3s ease-out, fadeOut 0.5s ease-out 4.5s forwards;
    background-color: #fff3cd;
    border-left: none;
    border-bottom: 3px solid #d32f2f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    pointer-events: auto;
    color: #856404;
}

.login-alert-top i {
    font-size: 18px;
    flex-shrink: 0;
    color: #d32f2f;
}

.login-alert-top span {
    flex: 0 1 auto;
    font-size: 14px;
    text-align: center;
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -100%);
    }
}

.login-alert {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.5s ease-in-out;
    border-left: 4px solid #d32f2f;
}

.login-alert i {
    font-size: 18px;
    flex-shrink: 0;
}

.login-alert span {
    flex: 1;
    font-size: 14px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ============================================================
   GROUPES DE CHAMPS
   ============================================================ */

.login-input-group {
    margin-bottom: 15px;
}

.login-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.login-label i {
    font-size: 14px;
    color: #4a90e2;
}

/* ============================================================
   CHAMPS DE SAISIE
   ============================================================ */

.login-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background-color: #f8f9fa;
}

.login-input:focus {
    outline: none;
    border: 1px solid #4a90e2;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.login-input::placeholder {
    color: #adb5bd;
}

/* ============================================================
   GESTION DU MOT DE PASSE
   ============================================================ */

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .login-input {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    z-index: 10;
}

.password-toggle:hover {
    color: #4a90e2;
}

.password-toggle:focus {
    outline: none;
    color: #4a90e2;
}

.password-toggle i {
    font-size: 16px;
}

/* ============================================================
   BOUTON DE SOUMISSION
   ============================================================ */

.login-submit {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
    position: relative;
    overflow: hidden;
}

.login-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
    background: linear-gradient(135deg, #357abd 0%, #2a5f8f 100%);
}

.login-submit:active:not(:disabled) {
    transform: translateY(0);
}

.login-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-submit .submit-loader {
    display: inline-block;
}

.login-submit .submit-loader i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================================
   PIED DE PAGE DU FORMULAIRE
   ============================================================ */

.login-footer {
    margin-top: 15px;
    text-align: center;
}

.login-help-text {
    font-size: 12px;
    color: #6c757d;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.login-help-text i {
    font-size: 13px;
    color: #4a90e2;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 480px) {
    .login-container {
        padding: 15px;
    }
    
    .form-signin {
        padding: 30px 25px;
    }
    
    .login-title {
        font-size: 20px;
    }
    
    .login-logo img {
        max-width: 150px;
    }
}

/* ============================================================
   ACCESSIBILITÉ
   ============================================================ */

.login-input:focus-visible {
    outline: none;
    border: 1px solid #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.login-submit:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* ============================================================
   ANIMATION DE CHARGEMENT
   ============================================================ */

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.login-submit.loading {
    animation: pulse 1.5s ease-in-out infinite;
}
