/* Conteneur principal du formulaire */
.container {
    width: 100%;
    max-width: 400px; /* Limite la largeur du formulaire */
    padding: 30px;
    background-color: #ffffff; /* Fond blanc pour le formulaire */
    border-radius: 10px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1); /* Ombre douce */
    text-align: center; /* Centre le contenu du formulaire */
    margin: 0 auto; /* Centre horizontalement */
}

/* Pour centrer le formulaire verticalement */
main {
    display: flex;
    justify-content: center; /* Centre le formulaire horizontalement */
    align-items: center; /* Centre le formulaire verticalement */
    height: 60vh; /* Utilise toute la hauteur de la fenêtre */
    margin: 0; /* Enlève les marges par défaut */
}


/* Titre du formulaire */
h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333; /* Couleur sombre pour le titre */
    font-weight: 600;
}

/* Formulaire et ses champs */
form {
    display: flex;
    flex-direction: column;
}

/* Labels des champs de formulaire */
label {
    text-align: left;
    font-size: 14px;
    margin-bottom: 5px;
    color: #666;
}
.footer {
    margin-top: 60px;
}


/* Champs de saisie */
input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 2px solid #ddd; /* Bordure claire */
    border-radius: 8px;
    background-color: #f9f9f9;
    font-size: 16px;
    transition: border-color 0.3s; /* Transition au focus */
}

/* Focus sur les champs de saisie */
input[type="text"]:focus,
input[type="password"]:focus {
    border-color: #4CAF50; /* Couleur verte au focus */
    outline: none; /* Enlève le contour par défaut */
}

/* Bouton de soumission */
input[type="submit"] {
    background-color: #4CAF50; /* Couleur verte moderne */
    color: white;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease; /* Transition douce au survol */
    margin-top: 20px;
}

input[type="submit"]:hover {
    background-color: #45a049; /* Couleur au survol */
}

/* Message d'erreur ou de succès (optionnel) */
.alert {
    background-color: #ffcccc;
    color: #d8000c;
    padding: 10px;
    margin-top: 10px;
    border-radius: 8px;
    font-size: 14px;
}

/* Mode sombre */
.dark-mode {
    background-color: #121212 !important;
    color: #ffffff !important;
}

.dark-mode .container {
    background-color: #1e1e1e !important;
    box-shadow: 0 8px 15px rgba(255, 255, 255, 0.1) !important;
}

.dark-mode h2 {
    color: #ffffff !important;
}

.dark-mode label {
    color: #bbbbbb !important;
}

.dark-mode input[type="text"],
.dark-mode input[type="password"] {
    background-color: #2a2a2a !important;
    border: 2px solid #444444 !important; /* Bordure plus sombre */
    color: #ffffff !important;
}

.dark-mode input[type="text"]:focus,
.dark-mode input[type="password"]:focus {
    border-color: #66bb6a !important; /* Vert clair au focus */
    outline: none;
}

.dark-mode input[type="submit"] {
    background-color: #66bb6a !important; /* Vert clair */
    color: #ffffff !important;
}

.dark-mode input[type="submit"]:hover {
    background-color: #4caf50 !important; /* Survol en vert plus foncé */
}

.dark-mode .alert {
    background-color: #ff6666 !important;
    color: #d8000c !important;
}

.popup {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    padding: 20px;
    background: white;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    border-radius: 8px;
}
.popup-content {
    text-align: center;
}
.popup input {
    width: 100%;
    margin-bottom: 10px;
    padding: 5px;
}
.popup button {
    padding: 10px;
    width: 100%;
    background: #007BFF;
    color: white;
    border: none;
    cursor: pointer;
}
.popup button:hover {
    background: #0056b3;
}
.close {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 20px;
}


.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-container input[type="password"],
.password-container input[type="text"] {
    flex-grow: 1;
    padding-right: 40px; /* Espace pour le bouton */
}

.password-container .toggle-password {
    position: absolute;
    right: 10px;
    top: 11px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
}
.dark-mode-toggle{
    background: #007bff;
    color: #fff;
    padding: 1rem 1.5rem;
    justify-content: center;
    margin: 1rem;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 1rem;
}


/* Ajustement général pour le mode sombre */
body.darkmode {
    --bg: #222;
}

/* Réduction de la taille de l'icône pour mobile */
svg {
    width: 50px; /* Taille plus petite pour mobile */
    height: 50px;
}

/* light mode */
.darkmode-icon {
    .moon-shadow {
        transition: cx 400ms ease;
    }

    .rays {
        transition: stroke-dashoffset 400ms ease;
        stroke-dashoffset: 24;
        stroke-dasharray: 12;
    }

    .moon-shadow {
        fill: black;
    }

    .rays, .sun-stroke {
        stroke: #777;
        fill: none;
    }
}

/* dark mode */
.darkmode-checkbox:checked ~ label {
    cursor: pointer;
}

.darkmode-checkbox:checked ~ label .darkmode-icon .moon-shadow {
    cx: 40;
}

.darkmode-checkbox:checked ~ label .darkmode-icon .rays {
    stroke-dashoffset: 12;
    stroke-dasharray: 12;
}

/* Cacher l'input checkbox */
.darkmode-checkbox {
    display: none;
}

/* Styles pour l'icône du soleil et de la lune dans le label */
.darkmode-icon {
    transition: transform 0.4s ease;
}

/* Rotation en mode sombre */
.darkmode-checkbox:checked ~ label .darkmode-icon {
    transform: rotate(180deg);
}

/* Ajustement de la taille et de l'espacement pour mobile */
label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px; /* Réduction du padding */
    cursor: pointer;
}

/* Soleil plus petit */
.sun {
    fill: #ff7;
}

/* Media query pour écrans mobiles */
@media (max-width: 600px) {
    svg {
        width: 40px;
        height: 40px;
    }

    label {
        padding: 3px;
    }
}
