/* ========================================
   NEXSAS - STYLE_CONNEXION.CSS
   Style pour la page de connexion/inscription
   Direction artistique cohérente avec le dashboard
   ======================================== */

/* ========================================
   VARIABLES & RESET
   ======================================== */

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-dark: #1f2937;
    --text-medium: #4b5563;
    --text-light: #6b7280;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --border-radius: 16px;
    --border-radius-small: 12px;
    --border-radius-large: 20px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 40px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.2);
    --transition-normal: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;    
    align-items: stretch;
    color: var(--text-dark);
    line-height: 1.6;
    padding: 0;
}

main {
    flex: 1; /* pour occuper l’espace restant sans forcer */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 0;
}
/* ========================================
   ALERTES
   ======================================== */

.alert {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 600px;
    width: 90%;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-small);
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.4s ease-out;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
}

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

.alert-warning {
    background: rgba(251, 191, 36, 0.95);
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-success {
    background: rgba(16, 185, 129, 0.95);
    color: white;
    border-left: 4px solid #10b981;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.95);
    color: white;
    border-left: 4px solid #dc2626;
}

.alert .close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition-normal);
    margin-left: auto;
}

.alert .close:hover {
    opacity: 1;
}

/* ========================================
   CONTAINER PRINCIPAL
   ======================================== */

.container {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(102, 126, 234, 0.15);
    max-width: 500px;
    width: 100%;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.6s ease-out;
}

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

.col-sm-8 {
    width: 100%;
}

/* ========================================
   TITRE
   ======================================== */

h2 {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    text-align: center;
}

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

form {
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-normal);
    background: white;
    color: var(--text-dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: var(--text-light);
}

/* Champs avec erreur */
.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ========================================
   BOUTONS
   ======================================== */

.btn-container {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    flex: 1;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-dark {
    background: var(--text-dark);
    color: white;
    box-shadow: 0 4px 15px rgba(31, 41, 55, 0.3);
}

.btn-dark:hover {
    background: #374151;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(31, 41, 55, 0.4);
}


/* ========================================
   LIEN MOT DE PASSE OUBLIÉ
   ======================================== */

.mt-3 {
    margin-top: 1.5rem;
    text-align: center;
}

.mt-3 a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-normal);
    position: relative;
}

.mt-3 a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition-normal);
}

.mt-3 a:hover {
    color: var(--primary-dark);
}

.mt-3 a:hover::after {
    width: 100%;
}

/* ========================================
   MESSAGES D'ERREUR
   ======================================== */

.text-danger,
.alert-danger {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--danger-color);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-small);
    margin-top: 1rem;
    font-weight: 500;
}

/* ========================================
   FOOTER
   ======================================== */

footer {
    margin-top: auto;
    width: 100%;
}

/* Bouton retour à l'accueil en haut à gauche */
.back-to-home {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.back-to-home:hover {
    background: white;
    border-color: var(--primary-color);
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.back-to-home i {
    font-size: 1.1rem;
}

/* Responsive pour le bouton */
@media (max-width: 768px) {
    .back-to-home {
        top: 1rem;
        left: 1rem;
        padding: 0.7rem 1.25rem;
        font-size: 0.9rem;
    }

    .back-to-home span {
        display: none; /* Cache le texte sur mobile */
    }

    .back-to-home i {
        font-size: 1.2rem;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .back-to-home {
        top: 0.75rem;
        left: 0.75rem;
        padding: 0.65rem 1rem;
    }
}
/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }
    
    .container {
        padding: 2rem 1.5rem;
        margin: 1rem auto;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .btn-container {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem 1rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .form-control {
        padding: 0.75rem 0.85rem;
        font-size: 0.95rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .alert {
        font-size: 0.875rem;
        padding: 0.85rem 1rem;
    }
}

/* ========================================
   ANIMATIONS SUPPLÉMENTAIRES
   ======================================== */

.form-group {
    animation: fadeInUp 0.5s ease-out backwards;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }

.btn-container {
    animation: fadeInUp 0.5s ease-out backwards;
    animation-delay: 0.4s;
}