@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
    --primary-purple: #1c3365;
    /* #9A77FF; /* Couleur de fond de l'illustration */
    --accent-red: #FF6B6B;
    /* Bouton Sign In */
    --accent-gradient: linear-gradient(-45deg, #fcc67d, #f679a3);
    --text-dark: #333;
    --text-light: #666;
    --input-bg: #F0F2F5;
    --border-radius-lg: 20px;
    --border-radius-sm: 10px;
    --white: #FFFFFF;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --50pourcent-darker: rgba(0, 0, 0, 0.5);

    --error: #000;
    --onError: #000;

    --error: rgb(186 26 26);
    --on-error: rgb(255 255 255);
    --error-container: rgb(255 218 214);
    --on-error-container: rgb(147 0 10);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: antiquewhite;
    /*#f0f2f5; /* Un gris clair pour le fond global */
    /*overflow: hidden; /* Pour éviter les barres de défilement si le contenu dépasse */
    background-image: url(../img/kiwi-bird-solid.svg);
    background-repeat: repeat;
    background-size: 50px;
}

.login-container {
    display: flex;
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    /*box-shadow: var(--shadow);*/
    max-width: 1000px;
    width: 90%;
    overflow-x: hidden;
    min-height: 600px;
    /* Pour s'assurer qu'il y ait de la place */
    margin: 30px;
    border: 1px solid var(--50pourcent-darker);
}

.illustration-section {
    flex: 1;
    /*background-color: var(--primary-purple);*/
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    /* Pour positionner l'image */
}

.illustration-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius-lg);
    display: block;
    /* Supprime l'espace sous l'image */
    /*filter: drop-shadow(5px 5px 15px rgba(0,0,0,0.2)); /* Petite ombre pour la 3D */
}

.form-section {
    flex: 1.2;
    /* Un peu plus d'espace pour le formulaire */
    display: flex;
    flex-direction: column;
    padding: 20px 40px;
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(10px);
    /* Effet de flou du verre dépoli */
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    /* Pour qu'il corresponde au conteneur */
}

.header-panel {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.header-panel svg {
    height: 40px;
    width: 40px;
    padding: 8px;
    border-radius: 50%;
    transition: all .3s;
}

.header-panel svg:hover {
    background-color: #bbbbbb;
}

.register-link {
    text-align: right;
    font-size: 0.9em;
    color: var(--text-light);
    /* margin-bottom: 20px; */
}

.register-link a {
    color: var(--primary-purple);
    text-decoration: none;
    font-weight: 600;
}

.form-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Centrer verticalement le contenu du formulaire */
}

h1 {
    font-size: 2.5em;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-weight: 700;
}

p {
    font-size: 1.1em;
    color: var(--text-light);
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 15px 20px;
    border: none;
    background-color: var(--input-bg);
    border-radius: var(--border-radius-sm);
    font-size: 1em;
    color: var(--text-dark);
    outline: none;
    transition: all 0.3s ease;
}

.input-group input::placeholder,
.input-group select::placeholder {
    color: var(--text-light);
}

.input-group input:disabled,
.input-group select:disabled {
    filter: opacity(0.7);
    cursor: not-allowed;
}

.input-group input:focus,
.input-group select:focus {
    box-shadow: 0 0 0 2px var(--primary-purple);
    background-color: var(--white);
}

.input-group:has(select) {
    display: flex;
    justify-content: space-between;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.input-group select {
    /* width: 100%; */
    flex: 1;
    text-align: center;
}

.input-group select option {
    text-align: center;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.password-toggle.hidden {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zM373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5L373 389.9z"/></svg>');
}


.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.recovery-password {
    text-align: right;
    display: block;
    font-size: 0.9em;
    color: var(--text-light);
    text-decoration: none;
    margin-bottom: 30px;
    transition: color 0.3s ease;
}

.recovery-password:hover {
    color: var(--primary-purple);
    text-decoration: underline;
}

.sign-in-button {
    width: 100%;
    padding: 15px;
    background-color: var(--accent-red);
    background: var(--accent-gradient);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    background-size: 300% 300%;
}

.sign-in-button:hover {
    animation: gradient 5s ease infinite;
    background-color: #e05e5e;
    /* Un rouge un peu plus foncé */
    transform: translateY(-2px);
}

.center:has(.simple-button) {
    display: flex;
    width: 100%;
    justify-content: flex-end;
}

.simple-button {
    padding: 15px 20px;
    background-color: #000;
    color: #FFF;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all .3s;
    font-size: 16px;
}

.simple-button:hover {
    transform: translateY(-2px);
}

.simple-button:active {
    filter: contrast(0.3);
    transform: translateY(-2px);
}

.simple-button:disabled {
    filter: opacity(0.3);
    cursor: not-allowed;
}

.or-continue-with {
    text-align: center;
    margin: 40px 0 20px;
    color: var(--text-light);
    position: relative;
}

.or-continue-with::before,
.or-continue-with::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 32%;
    height: 1px;
    background-color: #ddd;
}

.or-continue-with::before {
    left: 0;
}

.or-continue-with::after {
    right: 0;
}

.social-login {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-button {
    width: 60px;
    height: 60px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background-color: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.social-button:hover {
    border-color: var(--primary-purple);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.social-button img {
    width: 28px;
    height: 28px;
}

.boxError {
    display: none;
    opacity: 0;
    margin: 8px 0px;
    background-color: var(--error-container);
    padding: 8px 20px;
    border-radius: var(--border-radius-sm);
    color: var(--on-error-container);
    transition: all 0.3s ease-out;
}

.boxError.show {
    display: block;
    opacity: 1;
}

.popup_bg {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--50pourcent-darker);
    /* display: flex; */
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.popup_bg.show {
    display: flex;
}

.popup_bg .content {
    background-color: var(--white);
    padding: 64px;
    border-radius: 8px;
    display: flex;
    width: 50%;
    min-width: fit-content;
    max-width: 300px;
    flex-direction: column;
    align-items: center;
}

.loader {
    filter: url('#goo');
    width: 150px;
    height: 150px;
    margin: 16px;
    animation: shapeRound 18s ease-out infinite;
}

.loader::before {
    content: "";
    display: block;
    height: 80%;
    width: 80%;
    transform: translate(10%, 10%);
    background: var(--accent-gradient);

    animation: shapeMorph 6s ease infinite;
}

@keyframes shapeMorph {

    /* Utilisation de 8 points pour toutes les formes pour un morphing fluide */
    0% {
        clip-path: polygon(25% 0%, 75% 0%, 75% 100%, 25% 100%, 25% 0%, 75% 0%);
    }

    /* Oval */
    20% {
        clip-path: polygon(50% 0%, 100% 100%, 0% 100%, 0% 100%, 0% 100%, 50% 0%);
    }

    /* Triangle */
    40% {
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 100% 100%, 0% 100%, 0% 0%);
    }

    /* Carré */
    60% {
        clip-path: polygon(50% 0%, 50% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    }

    /* Pentagone */
    80% {
        clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    }

    /* Hexagone */
    100% {
        clip-path: polygon(25% 0%, 75% 0%, 75% 100%, 25% 100%, 25% 0%, 75% 0%);
    }

    /* Retour à l'Oval */
}

@keyframes shapeRound {
    0% {
        transform: rotate(0deg);
    }

    10% {
        transform: rotate(36deg);
    }

    20% {
        transform: rotate(72deg);
    }

    30% {
        transform: rotate(108deg);
    }

    40% {
        transform: rotate(144deg);
    }

    50% {
        transform: rotate(180deg);
    }

    60% {
        transform: rotate(216deg);
    }

    70% {
        transform: rotate(252deg);
    }

    80% {
        transform: rotate(288deg);
    }

    90% {
        transform: rotate(324deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


/* Media Queries for Responsiveness */
@media (max-width: 900px) {
    .login-container {
        flex-direction: column;
        width: 100%;
        max-width: 500px;
        /* Sur les petits écrans, le formulaire prend plus de place */
        min-height: auto;
        margin: 0px;
    }

    .illustration-section {
        display: none;
        /*height: 250px;
        border-bottom-left-radius: 0;
        border-top-right-radius: var(--border-radius-lg);*/
    }

    .form-section {
        padding: 30px;
        border-top-left-radius: 0;
        border-bottom-left-radius: var(--border-radius-lg);
    }

    h1 {
        font-size: 2em;
    }

    p {
        font-size: 1em;
    }
}

@media (max-width: 500px) {
    .login-container {
        min-height: 100vh;
        border-radius: 0px;
        border: none;
    }

    .form-section {
        padding: 20px;
    }

    .register-link {
        margin-bottom: 15px;
    }

    .social-button {
        width: 50px;
        height: 50px;
    }

    .social-button img {
        width: 24px;
        height: 24px;
    }
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* New layout wrapper for navigation and content area */
.account-main-layout {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    /* Default for mobile: nav on top, content below */
    gap: 20px;
    width: 100%;
    height: 100%;
    /* Important for vertical stretching */
}

/* Navigation Rail (Desktop) / Navigation Bar (Mobile) */
.account-nav {
    background-color: var(--input-bg);
    border-radius: var(--border-radius-sm);
    padding: 10px 0;
    flex-shrink: 0;
    width: 100%;
    overflow-x: scroll;
}

/* width */
.account-nav::-webkit-scrollbar {
  height: 4px;
}

/* Track */
.account-nav::-webkit-scrollbar-track {
  background: #f1f1f1; 
}
 
/* Handle */
.account-nav::-webkit-scrollbar-thumb {
  background: #888; 
  transition: all .3s ease;
  border-radius: 4px;
}

/* Handle on hover */
.account-nav::-webkit-scrollbar-thumb:hover {
  background: #555; 
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    /* Horizontal by default for mobile nav bar */
    justify-content: space-around;
}

.nav-list li {
    margin-bottom: 0;
}

.nav-link {
    display: flex;
    flex-direction: column;
    /* Stack icon and text for mobile */
    align-items: center;
    padding: 10px 15px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    border-bottom: 3px solid transparent;
    text-align: center;
    font-size: 0.9em;
    border-radius: 0px;

}

.nav-link:hover {
    color: var(--primary-purple);
}

.nav-link.active {
    color: var(--primary-purple);
    border-bottom-color: var(--primary-purple);
}

.nav-link svg {
    margin-right: 0;
    margin-bottom: 5px;
    height: 20px;
    width: 20px;
}

.nav-link:hover svg {
    fill: var(--primary-purple);
}

.nav-link.active svg {
    fill: var(--primary-purple);
}

.nav-link.logout-link {
    color: var(--accent-red);
    --primary-purple: var(--error);
}

.nav-link.logout-link svg {
    fill: var(--accent-red);
}

/* Account Content Area */
.account-content-area {
    flex-grow: 1;
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    overflow-y: auto;
    /* Allow vertical scrolling for content */
    min-height: 400px;
    /* Minimum height for content area on mobile */
}

.account-section {
    display: none;
    margin-top: 32px;
}

.account-section.active {
    display: block;
}

/* Ajustements pour le container principal après suppression de l'illustration */
@media (min-width: 901px) {
    .login-container {
        max-width: 1000px;
        /* On donne un peu plus d'espace, maintenant que l'image est partie en vacances */
    }

    .form-section:has(.account-main-layout) {
        padding: 0;
    }

    .register-link {
        /* On déplace ce lien pour qu'il ne gêne pas la navigation latérale */
        /* position: absolute;
        top: 20px;
        right: 40px; */
        width: auto;
        z-index: 1;
    }

    /* Le nouveau layout pour la navigation et le contenu */
    .account-main-layout {
        flex-direction: row;
        /* La nav à gauche, le contenu à droite, comme les grands ! */
        align-items: stretch;
        /* Les enfants s'étirent pour remplir la hauteur */
        height: 100%;
        /* S'assure que ce conteneur prend toute la hauteur disponible */
    }

    /* La Navigation Rail qui fait toute la hauteur */
    .account-nav {
        width: 200px;
        /* Une largeur fixe pour notre belle rail */
        min-width: 150px;
        padding: 20px 0;
        border-radius: var(--border-radius-lg) 0 0 var(--border-radius-lg);
        /* Seuls les coins gauches sont arrondis */

        align-self: stretch;
        /* Confirme qu'elle s'étire verticalement */
    }

    .nav-list {
        flex-direction: column;
        /* Les éléments de la liste s'empilent verticalement */
        justify-content: flex-start;
        /* Aligne les éléments en haut */
        height: 100%;
        /* La liste aussi doit s'étirer ! */
    }

    .nav-list li {
        margin-bottom: 5px;
        /* Un petit espace entre les éléments */
    }

    .nav-link {
        flex-direction: row;
        /* Icône et texte côte à côte */
        justify-content: flex-start;
        /* Aligne le texte à gauche */
        padding: 12px 20px;
        border-bottom: none;
        /* Plus de bordure en bas pour la version desktop */
        border-left: 5px solid transparent;
        /* Une jolie petite barre latérale active */
        border-radius: 0px;
        border-top-right-radius: var(--border-radius-sm);
        border-bottom-right-radius: var(--border-radius-sm);
    }

    .nav-link:hover {
        background-color: color-mix(in srgb, var(--primary-purple), #FFF 90%);
    }

    .nav-link svg {
        margin-right: 10px;
        /* Un peu d'air entre l'icône et le texte */
        margin-bottom: 0;
    }

    .nav-link.active {
        border-bottom-color: transparent;
        /* Pas de bordure en bas */
        border-left-color: var(--primary-purple);
        /* La bordure magique qui indique la section active */
        background-color: color-mix(in srgb, var(--primary-purple), #FFF 80%);
    }

    /* La zone de contenu à côté de la navigation */
    .account-content-area {
        padding: 20px 40px;
        flex-grow: 1;
        /* Prend tout l'espace restant */
        border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
        /* Coins arrondis seulement à droite */
        height: 100%;
        /* Prend aussi toute la hauteur */
        min-height: auto;
        /* Supprime la hauteur minimale pour le desktop */
    }
}

.list-box {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.list-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: relative;
    min-height: 120px;
    gap: 16px;
    border: #bbbbbb 1px solid;
    border-radius: var(--border-radius-lg);
    padding: 4px;
    flex-wrap: wrap;
}

.list-item:not(:first-child)::before {
    /* content: ""; */
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translate(-50%);
    height: 4px;
    width: 30%;
    border-radius: 4px;
    background-color: #bbbbbb;
}

.list-icon {
    height: 100px;
    width: 100px;
    object-fit: contain;
    border-radius: var(--border-radius-lg);
}

.list-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

span.enabled {
    --statusText: "Actif";
    --statusColor: green;
}

span.disabled {
    --statusText: "Désactivé";
    --statusColor: red;
}


span.enabled,
span.disabled {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

span.enabled::before,
span.disabled::before {
    content: "";
    height: 8px;
    width: 8px;
    border-radius: 50%;
    background-color: var(--statusColor);
}

span.enabled::after,
span.disabled::after {
    content: var(--statusText);
    color: var(--statusColor);
}

.list-buttons {
    margin-right: 8px;
}

.list-buttons button,
.list-buttons a {
    background-color: antiquewhite;
    color: black;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    border: 1px solid #CCC;
    transition: all .3s;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.list-buttons button:hover,
.list-buttons a:hover {
    filter: brightness(.8);
}

.list-buttons svg {
    height: 14px;
}