/* ===== FICHIER login.css =====
 * Stylisation de la page de connexion
 * Approche Mobile First avec palette de couleurs stricte
 * ============================================== */

/* Variables CSS (à définir dans un fichier global ou ici) */
:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --accent-color: #06b6d4;
    --danger-color: #dc2626;
    --light-bg: #f8fafc;
    --dark-text: #1e293b;
}

/* ===== LAYOUT GÉNÉRAL ===== */
.container-fluid.min-vh-100 {
    background: linear-gradient(135deg, var(--light-bg) 0%, #e2e8f0 100%);
    min-height: 100vh !important;
    position: relative;
}

.container-fluid.min-vh-100::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 20% 80%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
                      radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* ===== CARTE DE CONNEXION ===== */
.card {
    border: none !important;
    border-radius: 1.5rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1),
                0 10px 25px -8px rgba(0, 0, 0, 0.08) !important;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.card:hover {
    box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.15),
                0 12px 32px -8px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-2px);
}

.card-body {
    padding: 2.5rem !important;
}

/* ===== TITRE ===== */
.card-body h2 {
    color: var(--dark-text);
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 2rem !important;
    position: relative;
}

.card-body h2::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

/* ===== FORMULAIRE ET CHAMPS ===== */
.form-label {
    color: var(--dark-text);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.form-control {
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #ffffff;
    min-height: 3rem;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(6, 182, 212, 0.15);
    outline: none;
    background-color: #ffffff;
}

.form-control::placeholder {
    color: #94a3b8;
    font-size: 0.95rem;
}

/* État d'erreur */
.form-control.is-invalid {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.15) !important;
}

.invalid-feedback {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ===== CHAMP MOT DE PASSE ET BOUTON TOGGLE ===== */
.position-relative {
    position: relative;
}

#togglePassword {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    color: var(--secondary-color);
    font-size: 1.1rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    z-index: 10;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
}

#togglePassword:hover {
    background-color: rgba(100, 116, 139, 0.1) !important;
    color: var(--dark-text);
    transform: translateY(-50%) scale(1.05);
}

#togglePassword:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.3);
}

#togglePassword:active {
    transform: translateY(-50%) scale(0.95);
}

/* ===== CHECKBOX SE SOUVENIR ===== */
.form-check {
    padding-left: 0;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(6, 182, 212, 0.15);
}

.form-check-label {
    color: var(--secondary-color);
    font-size: 0.95rem;
    cursor: pointer;
}

/* ===== BOUTONS ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 3.25rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--secondary-color);
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    border-radius: 0.75rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -5px rgba(37, 99, 235, 0.25);
}

.btn-outline-secondary {
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    background: transparent;
    border-radius: 0.75rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -5px rgba(100, 116, 139, 0.25);
}

/* ===== LIENS ===== */
a.text-decoration-none {
    color: var(--secondary-color);
    transition: all 0.2s ease;
    font-weight: 500;
}

a.text-decoration-none:hover {
    color: var(--primary-color);
    text-decoration: underline !important;
}

/* ===== SÉPARATEUR ===== */
hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 2rem 0 !important;
}

/* ===== ALERTES ===== */
.alert-danger {
    background-color: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: var(--danger-color);
    border-radius: 0.75rem;
    padding: 1rem;
    font-size: 0.95rem;
}

/* ===== NOTE DE SÉCURITÉ ===== */
.text-center.mt-4 small {
    color: var(--secondary-color);
    font-size: 0.85rem;
    font-weight: 500;
}

.text-muted {
    color: var(--secondary-color) !important;
}

/* ===== RESPONSIVE DESIGN ===== */
/* Mobile Small (< 576px) */
@media (max-width: 575.98px) {
    .card-body {
        padding: 1.5rem !important;
    }
    
    .card-body h2 {
        font-size: 1.5rem;
    }
    
    .btn-primary {
        padding: 1rem;
        font-size: 0.95rem;
    }
    
    .d-grid.gap-2.d-md-flex .btn {
        margin-bottom: 0.5rem;
    }
}

/* Tablet (576px - 768px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .card-body {
        padding: 2rem !important;
    }
}

/* Desktop (≥ 768px) */
@media (min-width: 768px) {
    .card {
        max-width: 450px;
        margin: 0 auto;
    }
    
    .card-body h2 {
        font-size: 1.875rem;
    }
}

/* Large Desktop (≥ 992px) */
@media (min-width: 992px) {
    .card-body {
        padding: 3rem !important;
    }
}

/* ===== ANIMATIONS ET MICRO-INTERACTIONS ===== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: slideInUp 0.6s ease-out;
}

/* Animation pour les champs en focus */
.form-control:focus + label,
.form-control:not(:placeholder-shown) + label {
    transform: translateY(-1.5rem) scale(0.85);
    color: var(--accent-color);
}

/* Smooth scrolling pour toute la page */
html {
    scroll-behavior: smooth;
}