@import url('https://fonts.googleapis.com/css2?family=Old+Standard+TT:ital,wght@0,400;0,700;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

*{  margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Montserrat', sans-serif;
}

body{
    background-color: #c9d6ff;
    background: linear-gradient(to right, #e2e2e2, #c9d6ff);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    height: 100vh;
}

.login-to-home {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.login-to-home img {
    max-width: 60px;
    height: auto;
}


.login-container{
    background-color: #fff;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
    width: 860px;
    max-width: 100%;
    min-height: 560px;
}

.login-container p{
    font-size: 16px;
    line-height: 20px;
    letter-spacing: 0.3px;
    margin: 5px;
}

.login-container span{
    font-size: 12px;
}

.login-container a{
    color: #333;
    font-size: 13px;
    text-decoration: none;
    margin: 15px 0 10px;
}

.login-container button{
    background-color: #512da8;
    color: #fff;
    font-size: 12px;
    padding: 10px 45px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 10px;
    cursor: pointer;
}

.login-container button.login-hidden{
    background-color: transparent;
    border-color: #fff;
}

.login-container form{
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    height: 100%;
}

.login-container input{
    background-color: #eee;
    border: none;
    margin: 8px 0;
    padding: 10px 20px;
    font-size: 13px;
    border-radius: 8px;
    width: 300px;
    outline: none;
    box-sizing: border-box;
    display: block;
}

.login-container label {
    display: none;
}

.login-form-container{
    position: absolute;
    top: 0;
    height: 100%;
    transition: all 0.6s ease-in-out;
}

.login-sign-in{
    left: 0;
    width: 50%;
    z-index: 2;
}

.login-container.active .login-sign-in{
    transform: translateX(100%);
}

.login-sign-up{
    left: 0;
    width: 50%;
    opacity: 0;
    z-index: 1;
}

.login-container.active .login-sign-up{
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    animation: move 0.6s;
}

@keyframes move{
    0%, 49.99%{
        opacity: 0;
        z-index: 1;
    }
    50%, 100%{
        opacity: 1;
        z-index: 5;
    }
}

.login-social-icons{
    margin: 20px 0;
}

.login-social-icons a{
    border: 1px solid #ccc;
    border-radius: 20%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin: 0 3px;
    width: 40px;
    height: 40px;
}

.login-toggle-container{
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: all 0.6s ease-in-out;
    border-radius: 150px 0 0 100px;
    z-index: 1000;
}

.login-container.active .login-toggle-container{
    transform: translateX(-100%);
    border-radius: 0 150px 100px 0;
}

.login-toggle{
    background-color: #512da8;
    height: 100%;
    background: linear-gradient(to right, #5c6bc0, #512da8);
    color: #fff;
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: all 0.6s ease-in-out;
}

.login-container.active .login-toggle{
    transform: translateX(50%);
}

.login-toggle-panel{
    position: absolute;
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 30px;
    text-align: center;
    top: 0;
    transform: translateX(0);
    transition: all 0.6s ease-in-out;
}

.login-toggle-left{
    transform: translateX(-200%);
}

.login-container.active .login-toggle-left{
    transform: translateX(0);
}

.login-toggle-right{
    right: 0;
    transform: translateX(0);
}

.login-container.active .login-toggle-right{
    transform: translateX(200%);
}

.errorlist{
    padding: 10px 20px;
    margin: 5px;
    border-radius: 10px;
    font-size: 10px;
    display: flex;
    align-items: center;
    font-weight: 600;
    list-style: none;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.errorlist li {
    margin: 0;
    padding: 0;
}

.errorlist.nonfield {

}

.errorlist.success {
    background-color: #d4edda;
    color: #155724;
}

.floating-symbols {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1; /* Derrière tout le contenu */
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); /* Optionnel: fond léger */
}

.symbol {
    position: absolute;
    color: rgba(7, 1, 21, 0.881);
    font-family: "MS Mincho", "Hiragino Mincho Pro", serif;
    user-select: none;
    will-change: transform;
    animation: float-around infinite ease-in-out;
}

@keyframes float-around {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }
    33% {
        transform: translate3d(30px, -50px, 0) rotate(10deg);
    }
    66% {
        transform: translate3d(-20px, -100px, 0) rotate(-10deg);
    }
    100% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }
}

/* Style pour le texte de bascule mobile (caché par défaut sur PC) */
.mobile-toggle-text {
    display: none;
    margin-top: 20px;
    font-size: 14px;
}
.mobile-toggle-text a {
    color: #512da8;
    font-weight: bold;
    text-decoration: underline;
    margin: 0;
    font-size: 14px;
}

/* =========================================
   TABLETTE (max-width: 1024px)
   ========================================= */
@media (max-width: 1024px) {
    .login-container {
        width: 90vw; /* Utilise 90% de la largeur de l'écran */
        min-height: 500px;
    }

    .login-container h1 {
        font-size: 24px;
    }

    .login-container input {
        width: 100%; /* Les inputs prennent toute la place disponible */
        max-width: 280px;
    }
}

/* --- Ajouts pour Mobile et Tablette --- */

/* Style pour le texte de bascule mobile (caché par défaut sur PC) */
.mobile-toggle-text {
    display: none;
    margin-top: 20px;
    font-size: 14px;
}
.mobile-toggle-text a {
    color: #512da8;
    font-weight: bold;
    text-decoration: underline;
    margin: 0;
    font-size: 14px;
}

/* =========================================
   TABLETTE (max-width: 1024px)
   On garde l'animation mais on réduit la taille
   ========================================= */
@media (max-width: 1024px) {
    .login-container {
        width: 90vw; /* Utilise 90% de la largeur de l'écran */
        min-height: 500px;
    }

    .login-container h1 {
        font-size: 24px;
    }

    .login-container input {
        width: 100%; /* Les inputs prennent toute la place disponible */
        max-width: 280px;
    }
}

/* =========================================
   MOBILE (max-width: 768px)
   On désactive l'animation slide et on passe en mode Stack
   ========================================= */
@media (max-width: 768px) {
    body {
        /* Empêche le débordement horizontal */
        overflow-x: hidden;
        padding: 20px;
    }

    .login-to-home {
        top: 10px;
        left: 10px;
    }

    .login-to-home img {
        max-width: 40px; /* Plus petit logo */
    }

    .login-container {
        width: 100%;
        max-width: 400px;
        min-height: auto; /* La hauteur s'adapte au contenu */
        height: auto;
        border-radius: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
        overflow: hidden; /* Important pour couper les débordements */
        padding-bottom: 20px;
    }

    /* On cache le panneau coulissant coloré */
    .login-toggle-container {
        display: none;
    }

    /* On affiche les liens de bascule mobile */
    .mobile-toggle-text {
        display: block;
    }

    /* Réinitialisation des conteneurs de formulaire */
    .login-form-container {
        position: relative; /* Plus d'absolute positioning */
        width: 100%;
        height: auto;
        top: 0;
        left: 0;
        transition: none; /* On enlève l'animation de glissement */
        padding: 20px;
    }

    .login-container form {
        padding: 20px 10px;
    }

    /* --- LOGIQUE D'AFFICHAGE MOBILE (Basée sur la classe .active) --- */

    /* Par défaut (sans classe .active) : On voit le LOGIN, on cache le SIGNUP */
    .login-sign-in {
        display: block;
    }
    .login-sign-up {
        display: none;
        opacity: 1; /* Reset de l'opacité */
        transform: none; /* Reset du transform */
        animation: none;
        z-index: 1;
    }

    /* Quand le container a la classe .active (mode inscription activé) */
    /* On cache le LOGIN */
    .login-container.active .login-sign-in {
        display: none;
        transform: none;
    }

    /* On affiche le SIGNUP */
    .login-container.active .login-sign-up {
        display: block;
        transform: none;
        opacity: 1;
        animation: fadein 0.5s; /* Petit effet d'apparition simple */
    }

    @keyframes fadein {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

/* =========================================
   MOBILE (max-width: 768px)
   On désactive l'animation slide et on passe en mode Stack
   ========================================= */
@media (max-width: 768px) {
    body {
        /* Empêche le débordement horizontal */
        overflow-x: hidden;
        padding: 20px;
    }

    .login-to-home {
        top: 10px;
        left: 10px;
    }

    .login-to-home img {
        max-width: 40px; /* Plus petit logo */
    }

    .login-container {
        width: 100%;
        max-width: 400px;
        min-height: auto; /* La hauteur s'adapte au contenu */
        height: auto;
        border-radius: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
        overflow: hidden; /* Important pour couper les débordements */
        padding-bottom: 20px;
    }

    /* On cache le panneau coulissant coloré */
    .login-toggle-container {
        display: none;
    }

    /* On affiche les liens de bascule mobile */
    .mobile-toggle-text {
        display: block;
        text-align: center;
    }

    /* Réinitialisation des conteneurs de formulaire */
    .login-form-container {
        position: relative; /* Plus d'absolute positioning */
        width: 100%;
        height: auto;
        top: 0;
        left: 0;
        transition: none; /* On enlève l'animation de glissement */
        padding: 20px;
    }

    .login-container form {
        padding: 20px 10px;
    }

    /* --- LOGIQUE D'AFFICHAGE MOBILE (Basée sur la classe .active) --- */

    /* Par défaut (sans classe .active) : On voit le LOGIN, on cache le SIGNUP */
    .login-sign-in {
        display: block;
    }
    .login-sign-up {
        display: none;
        opacity: 1;
        transform: none;
        animation: none;
        z-index: 1;
    }

    /* Quand le container a la classe .active (mode inscription activé) */
    /* On cache le LOGIN */
    .login-container.active .login-sign-in {
        display: none;
        transform: none;
    }

    /* On affiche le SIGNUP */
    .login-container.active .login-sign-up {
        display: block;
        transform: none;
        opacity: 1;
        animation: fadein 0.5s; /* Petit effet d'apparition simple */
    }

    @keyframes fadein {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

.non-cliquable {
position: relative;
cursor: not-allowed;  /*Change le curseur en sens interdit */
display: inline-block;
}

/* =========================================
   STYLES POUR LES CHAMPS DE FORMULAIRE CSS PUR
   ========================================= */

/* Style des inputs texte, email, password, number */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', 'Montserrat', sans-serif;
    background-color: #fafafa;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-bottom: 12px;
}

.form-input:focus {
    outline: none;
    border-color: #512da8;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(81, 45, 168, 0.1);
}

.form-input::placeholder {
    color: #999;
}

/* Style des selects */
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', 'Montserrat', sans-serif;
    background-color: #fafafa;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-bottom: 12px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-select:focus {
    outline: none;
    border-color: #512da8;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(81, 45, 168, 0.1);
}

/* Style des checkboxes */
.form-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #512da8;
    margin-right: 8px;
    margin-bottom: 12px;
    vertical-align: middle;
}

.form-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(81, 45, 168, 0.1);
}

/* Style des file inputs */
.form-file {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', 'Montserrat', sans-serif;
    background-color: #fafafa;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-bottom: 12px;
    cursor: pointer;
}

.form-file:focus {
    outline: none;
    border-color: #512da8;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(81, 45, 168, 0.1);
}

.form-file::file-selector-button {
    padding: 8px 16px;
    background-color: #512da8;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 12px;
    transition: background-color 0.3s ease;
}

.form-file::file-selector-button:hover {
    background-color: #5c6bc0;
}

/* Aides et messages d'erreur */
.helptext {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    margin-bottom: 8px;
}

.helptext ul {
    list-style: none;
    padding-left: 0;
    margin: 4px 0 0 0;
}

.helptext li {
    font-size: 12px;
    color: #666;
}

/* Messages d'erreur de champ individuel */
.errorlist {
    padding: 10px 12px;
    margin-top: 4px;
    margin-bottom: 12px;
    border-radius: 6px;
    font-size: 12px;
    list-style: none;
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
    font-weight: 500;
}

.errorlist li {
    margin: 3px 0;
    padding-left: 0;
}

.errorlist li:first-child {
    margin-top: 0;
}

.errorlist li:last-child {
    margin-bottom: 0;
}

/* =========================================
   CHAMP EMAIL READONLY
   ========================================= */
.form-input-readonly {
    background-color: #f5f5f5 !important;
    color: #333 !important;
    cursor: not-allowed !important;
    opacity: 0.85;
}

.form-input-readonly:focus {
    border-color: #e0e0e0 !important;
    box-shadow: none !important;
    background-color: #f5f5f5 !important;
}

/* =========================================
   NUMÉRO DE TÉLÉPHONE AVEC DRAPEAU
   ========================================= */
.phone-input {
    padding-left: 48px !important;
    background-position: 12px center !important;
    background-repeat: no-repeat !important;
}

.iti-flag {
    background-image: url('https://cdn.jsdelivr.net/npm/intl-tel-input@17.0.8/build/img/flags.png');
}

/* Conteneur du sélecteur de pays */
.iti-container {
    position: relative;
}

.iti {
    position: relative;
    display: inline-block;
    width: 100%;
}

.iti-flag {
    width: 16px;
    height: 11px;
    background-size: 5652px 11px;
    background-repeat: no-repeat;
}

.iti-flag.country {
    width: 28px;
    height: 20px;
    background-size: 5652px 20px;
}

/* Dropdown du sélecteur de pays */
.iti__country-list {
    position: absolute;
    z-index: 2;
    list-style: none;
    text-align: left;
    padding: 0;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.iti__country {
    padding: 8px 12px;
    cursor: pointer;
    list-style: none;
    transition: background-color 0.2s;
}

.iti__country:hover,
.iti__country.iti__preferred,
.iti__country.iti__active {
    background-color: #f0f0f0;
}

.iti__country.iti__active {
    background-color: #e8e8e8;
    font-weight: 600;
}

.iti__country-flag {
    margin-right: 8px;
    margin-top: 2px;
}

.iti__country-name {
    display: inline-block;
    margin-left: 8px;
}

/* Bouton du sélecteur de pays */
.iti__flag-container {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 48px;
    padding: 8px;
    background-color: #fafafa;
    border-right: 1px solid #e0e0e0;
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iti__flag {
    margin-right: 4px;
}

.iti__selected-country-flag {
    display: inline-block;
    margin-right: 4px;
}

.iti__selected-dial-code {
    margin-right: 4px;
    font-weight: 600;
    color: #512da8;
}

/* =========================================
   VALIDATION DU NUMÉRO DE TÉLÉPHONE
   ========================================= */
.phone-input-error {
    border-color: #c62828 !important;
    background-color: #ffebee !important;
}

.phone-error-message {
    color: #c62828;
    font-size: 12px;
    margin-top: 4px;
    margin-bottom: 8px;
}

.iti {
    width: 100%;
}

.iti-flag {
    display: inline-block;
}

/* Ajustement du padding pour le drapeau */
.iti__flag-container {
    padding: 0;
}

.iti__input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', 'Montserrat', sans-serif;
    background-color: #fafafa;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-bottom: 12px;
}

.iti__input:focus {
    outline: none;
    border-color: #512da8;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(81, 45, 168, 0.1);
}

/* =========================================
   SÉLECTEUR DE PAYS (django-countries)
   ========================================= */
.country-select {
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 36px !important;
}

/* Styles pour le widget CountrySelect */
.django-countries-widget {
    width: 100%;
}

.django-countries-widget select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', 'Montserrat', sans-serif;
    background-color: #fafafa;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-bottom: 12px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.django-countries-widget select:focus {
    outline: none;
    border-color: #512da8;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(81, 45, 168, 0.1);
}
