/* ===== RESET ET VARIABLES - THÈME VERT ===== */
:root {
    --primary-dark: #4fd1c5;
    --primary-blue: #2d9c89;
    --accent-teal: #1e3a5f;
    --accent-emerald: #2a4a7a;
    --gradient-primary: linear-gradient(135deg, #4fd1c5 0%, #2d9c89 50%, #1e3a5f 100%);
    --gradient-secondary: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --shadow-soft: 0 8px 32px rgba(79, 209, 197, 0.12);
    --shadow-strong: 0 20px 60px rgba(79, 209, 197, 0.15);
    --border-radius: 16px;
}

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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #334155;
    overflow-x: hidden;
    background: var(--gradient-secondary);
}

/* ===== LAYOUT PRINCIPAL ===== */
.login-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ===== CÔTÉ GAUCHE AMÉLIORÉ ===== */
.left-side {
    flex: 1.2;
    background: var(--gradient-primary);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 3rem;
}

/* Background animé avec particules */
.left-side::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(79, 209, 197, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(45, 156, 137, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(30, 58, 95, 0.2) 0%, transparent 50%);
    animation: backgroundPulse 8s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Grille de points décorative */
.decorative-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridMove 20s linear infinite;
    opacity: 0.3;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}

/* Formes flottantes améliorées */
.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.floating-shape {
    position: absolute;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    animation: floatAdvanced 12s ease-in-out infinite;
}

.floating-shape i {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.5rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.527));
}

.floating-shape:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.15) rotate(8deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

/* Positions et tailles des formes */
.shape-1 { width: 80px; height: 80px; top: 8%; left: 8%; animation-delay: 0s; }
.shape-2 { width: 100px; height: 100px; top: 15%; right: 12%; animation-delay: 2s; border-radius: 50%; }
.shape-3 { width: 70px; height: 70px; top: 40%; left: 10%; animation-delay: 4s; }
.shape-4 { width: 90px; height: 90px; top: 35%; right: 20%; animation-delay: 1s; }
.shape-5 { width: 60px; height: 60px; top: 55%; left: 45%; animation-delay: 3s; border-radius: 20px; }
.shape-6 { width: 85px; height: 85px; bottom: 25%; right: 8%; animation-delay: 5s; }
.shape-7 { width: 70px; height: 70px; bottom: 15%; left: 12%; animation-delay: 2.5s; }
.shape-8 { width: 80px; height: 80px; bottom: 40%; right: 30%; animation-delay: 3.5s; }
.shape-9 { width: 90px; height: 90px; bottom: 8%; left: 35%; animation-delay: 4.5s; }
.shape-10 { width: 100px; height: 100px; top: 70%; left: 70%; animation-delay: 1.5s; }


@keyframes floatAdvanced {
    0%, 100% { 
        transform: translateY(0px) translateX(0px) rotate(0deg); 
        opacity: 0.8;
    }
    25% { 
        transform: translateY(-20px) translateX(10px) rotate(3deg); 
        opacity: 1;
    }
    50% { 
        transform: translateY(-35px) translateX(-5px) rotate(-2deg); 
        opacity: 0.9;
    }
    75% { 
        transform: translateY(-15px) translateX(-10px) rotate(1deg); 
        opacity: 1;
    }
}

/* Contenu gauche amélioré */
.left-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
    max-width: 480px;
}

.logo-section {
    margin-bottom: 3rem;
}
.navbar-brand img{
    border-radius: 10px;
}
.navbar-brand img:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
    border: 2px solid var(--glass-border);
    box-shadow: 0 0 10px 0 rgba(5, 4, 70, 0.1);
    background-color: #18375f54;
    border-radius: 10px;
}

.logo-container {
    width: 80px;
    height: 80px;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-soft);
}

.logo-container i {
    font-size: 2rem;
    color: #4fd1c5;
}

.brand-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
}

.brand-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 3rem;
    opacity: 0.9;
    color: #e2e8f0;
}

.features-grid {
    display: grid;
    gap: 1rem;
    text-align: left;
}

.feature-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(8px) translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4fd1c5, #2a4a7a);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-icon i {
    font-size: 1.1rem;
    color: white;
}

.feature-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: #f1f5f9;
}

/* ===== CÔTÉ DROIT AMÉLIORÉ ===== */
.right-side {
    flex: 1;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
}

.right-side::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: 
        radial-gradient(circle at 80% 20%, rgba(79, 209, 197, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, rgba(30, 58, 95, 0.03) 0%, transparent 50%);
}

.form-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 10;
}

.form-header {
    text-align: center;
    margin-bottom: 3rem;
}

.form-logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.form-logo .accent {
    color: #4fd1c5;
}

.welcome-message {
    font-size: 1rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 2rem;
}

/* ===== FORMULAIRE MODERNE ===== */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.input-container {
    position: relative;
}

/* Styles pour tous les inputs, y compris ceux générés par Django */
.form-input,
.input-container input,
.input-container textarea,
.input-container select {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-dark);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    font-family: inherit;
}

.form-input:focus,
.input-container input:focus,
.input-container textarea:focus,
.input-container select:focus {
    border-color: #4fd1c5;
    box-shadow: 0 0 0 3px rgba(79, 209, 197, 0.1), 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* Styles spécifiques pour les champs de mot de passe */
.input-container input[type="password"] {
    padding-right: 3.5rem;
}

/* Styles pour les champs avec bouton toggle */
.input-container:has(.password-toggle) input,
.input-container:has(.password-toggle) .form-input {
    padding-right: 3.5rem;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.form-input:focus + .input-icon {
    color: #4fd1c5;
}

.form-label {
    position: absolute;
    left: 3rem;
    top: 1rem;
    font-size: 1rem;
    color: #94a3b8;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.form-input:focus + .input-icon + .form-label,
.form-input:not(:placeholder-shown) + .input-icon + .form-label {
    top: -0.5rem;
    left: 0.75rem;
    font-size: 0.75rem;
    color: #4fd1c5;
    background: white;
    padding: 0 0.5rem;
    font-weight: 600;
}

/* Bouton d'affichage/masquage du mot de passe */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    z-index: 10;
}

.password-toggle:hover {
    color: #4fd1c5;
    background: rgba(79, 209, 197, 0.1);
}

.password-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 209, 197, 0.3);
}

.password-toggle i {
    font-size: 1rem;
    transition: all 0.3s ease;
}

/* Messages d'erreur */
.error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 500;
    background: rgba(220, 38, 38, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border-left: 3px solid #dc2626;
    animation: slideInError 0.3s ease-out;
}

@keyframes slideInError {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Champs avec erreurs */
.form-input.error,
.input-container input.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    animation: shake 0.5s ease-in-out;
}

.form-input.error:focus,
.input-container input.error:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

/* Animation de secousse pour les erreurs */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Alerte Bootstrap personnalisée */
.alert {
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    font-weight: 500;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.alert-success {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    border-left: 4px solid #16a34a;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* Options du formulaire */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.custom-checkbox input {
    opacity: 0;
    position: absolute;
}

.custom-checkbox input:checked + .checkmark {
    background: #4fd1c5;
    border-color: #4fd1c5;
}

.custom-checkbox input:checked + .checkmark::after {
    opacity: 1;
    transform: scale(1);
}

.checkmark {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: all 0.2s ease;
    opacity: 0;
}

/* Animation de la checkbox */
.custom-checkbox:hover .checkmark {
    border-color: #4fd1c5;
    transform: scale(1.05);
}

.checkbox-label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

.forgot-link {
    color: #4fd1c5;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #2d9c89;
}

/* ===== BOUTONS MODERNES ===== */
.button-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #4fd1c5, #2d9c89);
    color: white;
    box-shadow: 0 4px 20px rgba(79, 209, 197, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(79, 209, 197, 0.4);
}

.btn-outline {
    background: transparent;
    color: #4fd1c5;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-outline:hover {
    border-color: #4fd1c5;
    color: #4fd1c5;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(79, 209, 197, 0.2);
}

/* ===== FOOTER AMÉLIORÉ ===== */
.footer-text {
    text-align: center;
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.6;
}

.footer-text a {
    color: #4fd1c5;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-text a:hover {
    color: #2d9c89;
}

/* ===== ANIMATIONS ===== */
.fade-in {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .login-container {
        flex-direction: column;
    }

    .left-side {
        flex: none;
        min-height: 40vh;
        padding: 2rem;
    }

    .right-side {
        flex: 1;
        padding: 2rem;
    }

    .brand-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .left-side {
        min-height: 30vh;
        padding: 1.5rem;
    }

    .right-side {
        padding: 1.5rem;
    }

    .button-group {
        flex-direction: column;
    }

    .brand-title {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .left-side, .right-side {
        padding: 1rem;
    }

    .brand-title {
        font-size: 1.8rem;
    }

    .form-container {
        max-width: 100%;
    }
}

/* ===== ACCESSIBILITÉ ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.btn:focus-visible,
.form-input:focus-visible {
    outline: 2px solid #4fd1c5;
    outline-offset: 2px;
}

/* ===== STYLES SPÉCIFIQUES À L'INSCRIPTION ===== */
/* Styles pour les étapes du formulaire d'inscription */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: all 0.3s ease;
}

.step-dot.active {
    background: #4fd1c5;
    transform: scale(1.2);
}

.step-dot.completed {
    background: #2d9c89;
}

/* Styles spécifiques pour les champs d'inscription avec icônes */


/* Gestion des erreurs pour l'inscription */
.inscription-form .error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    padding-left: 15px;
}

.inscription-form .form-group input.is-invalid,
.inscription-form .form-group select.is-invalid,
.inscription-form .form-group textarea.is-invalid {
    border-color: #dc3545;
}

/* Style pour le téléphone avec indicatif */
.inscription-form .phone-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.inscription-form .phone-container select {
    max-width: 120px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 15px;
    font-size: 16px;
    background: white;
}

.inscription-form .phone-container select:focus {
    border-color: #4fd1c5;
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 209, 197, 0.1);
}

.inscription-form .phone-container .input-container {
    flex: 1;
}

.inscription-form .phone-container .input-icon {
    left: 15px;
}

.inscription-form .phone-container .form-label {
    left: 15px;
}

/* Style pour les boutons de bascule de mot de passe */
.inscription-form .password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.inscription-form .password-toggle:hover,
.inscription-form .password-toggle:focus {
    color: #4fd1c5;
    outline: none;
}

/* Styles pour l'indicatif téléphonique avec loader */
.inscription-form .phone-container select {
    max-width: 120px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 15px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
}

.inscription-form .phone-container select:focus {
    border-color: #4fd1c5;
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 209, 197, 0.1);
}

.inscription-form .phone-container select option {
    padding: 8px 12px;
    font-size: 14px;
}

/* Animation de chargement pour l'indicatif */
.inscription-form .phone-container select option[value=""] {
    color: #9ca3af;
    font-style: italic;
}

/* Animation de confirmation */
.inscription-form .phone-container select.confirming {
    border-color: #4fd1c5;
    box-shadow: 0 0 0 3px rgba(79, 209, 197, 0.1);
    animation: confirmPulse 0.5s ease-in-out;
}

@keyframes confirmPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}