/* Auth Modal — Connexion uniquement.
   Le modal Inscription est dans register-modal.css (réutilise .auth-modal-overlay,
   .auth-modal-container, .auth-modal-field, .auth-modal-btn). */

.auth-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1010;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-modal-overlay.active {
    display: flex;
}

.auth-modal-container {
    position: relative;
    background: var(--purple);
    color: #fff;
    padding: 50px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 40px;
    box-shadow: 0 0 35px rgba(132, 76, 170, 1);
}

/* Croix de fermeture */
.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: #fff;
    opacity: 0.5;
    padding: 4px 8px;
    transition: opacity 0.15s ease;
}

.auth-modal-close:hover,
.auth-modal-close:focus {
    opacity: 1;
    outline: none;
}

/* Fields (commun login + register) */
.auth-modal-field {
    margin-bottom: 12px;
}

.auth-modal-field label {
    display: block;
    margin-bottom: 6px;
    color: #fff;
    font-size: 0.875rem;
}

.auth-modal-field input[type="text"],
.auth-modal-field input[type="email"],
.auth-modal-field input[type="tel"],
.auth-modal-field input[type="password"],
.auth-modal-field input[type="number"],
.auth-modal-field input[type="date"] {
    width: 100%;
    padding: 10px 18px;
    background: #462C83;
    border: 2px solid var(--green);
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    border-radius: 25px;
}

.auth-modal-field input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.auth-modal-field input:focus {
    outline: none;
    background: var(--purple);
}

.auth-modal-field input[type="date"] {
    color: rgba(255, 255, 255, 0.6);
}

/* Select (sexe, dans register) */
#register-sex {
    width: 100%;
    padding: 10px 44px 10px 18px;
    background: #462C83;
    border: 2px solid var(--green);
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2326D276' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

#register-sex:focus {
    outline: none;
    background-color: var(--purple);
}

#register-sex option {
    color: #fff;
    background-color: var(--purple);
}

/* Checkboxes (pattern catalogue) */
.auth-modal-field input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    cursor: pointer;
    background: transparent;
    border: 2px solid var(--orange);
    border-radius: 7px;
    position: relative;
    margin-right: 8px;
    vertical-align: middle;
}

.auth-modal-field input[type="checkbox"]:checked {
    background: var(--orange);
    border-color: var(--orange);
}

.auth-modal-field input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Erreur / succès */
.auth-modal-error {
    color: #ff6b6b;
    margin-bottom: 12px;
    font-size: 0.875rem;
    display: none;
}

.auth-modal-error.show {
    display: block;
}

.auth-modal-success {
    color: var(--green);
    background: rgba(38, 210, 118, 0.1);
    border: 1px solid rgba(38, 210, 118, 0.3);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    border-radius: 12px;
}

/* Bouton principal (base — overridé sur login) */
.auth-modal-btn {
    width: 100%;
    padding: 10px 28px;
    background: var(--green);
    color: var(--purple);
    border: 2px solid var(--green);
    border-radius: 9999px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.1s ease;
    margin-top: 8px;
}

.auth-modal-btn:hover {
    opacity: 0.85;
}

.auth-modal-btn:active {
    transform: scale(0.98);
}

.auth-modal-btn-secondary {
    background: transparent;
    color: #fff;
}

.auth-modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    opacity: 1;
}

/* Mot de passe oublié */
.auth-modal-forgot {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.auth-modal-link {
    background: none;
    border: none;
    color: var(--green);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    font-family: var(--font-body);
}

.auth-modal-link:hover {
    text-decoration: underline;
    opacity: 0.9;
}

/* Trigger header */
#auth-modal-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ===== LOGIN — spécifique ===== */

.login-tab-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 48px;
    align-items: stretch;
    background: transparent;
    margin: 0;
}

.login-tab-left {
    text-align: center;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-tab-left .icon-account-login {
    width: 85%;
    height: 85%;
    color: var(--green);
}

.login-tab-right {
    align-content: center;
}

.login-tab-right form {
    width: 100%;
}

#login-tab input,
#login-tab button {
    width: 100%;
}

/* Inputs login — border blanc + pill (pour que la bulle s'aligne pile sur le coin),
   font banana quand on tape (comme la search bar du header), pas d'autofill jaune */
#auth-modal-overlay .auth-modal-field input {
    border-color: #fff;
    border-radius: 9999px;
    padding: 2px 56px 0 18px;
    height: 46px;
    font-family: var(--font-head);
    font-size: 1.75rem;
    line-height: 1;
    background: transparent;
}

#auth-modal-overlay .auth-modal-field input:focus {
    background: transparent;
}

/* Anti autofill Chrome (fond jaunâtre/blanc quand un password manager fill) */
#auth-modal-overlay .auth-modal-field input:-webkit-autofill,
#auth-modal-overlay .auth-modal-field input:-webkit-autofill:hover,
#auth-modal-overlay .auth-modal-field input:-webkit-autofill:focus,
#auth-modal-overlay .auth-modal-field input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--purple) inset !important;
    -webkit-text-fill-color: #fff !important;
    caret-color: #fff;
    transition: background-color 9999s ease-in-out 0s;
}

/* Input wrap avec icône badge à droite — partagé login + register
   (pattern barre de recherche header : cercle blanc qui épouse la courbe du pill) */
.auth-modal-input-wrap {
    position: relative;
}

.auth-modal-input-wrap input {
    padding-right: 56px;
}

.auth-modal-input-icon {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #fff;
    color: #fff;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.auth-modal-input-icon svg {
    width: 28px;
    height: 28px;
}

/* Toggle œil pour password — bouton natif, à gauche de la bulle clé */
.auth-modal-password-toggle {
    position: absolute;
    right: 55px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
}

.auth-modal-password-toggle svg {
    width: 22px;
    height: 22px;
}

.auth-modal-password-toggle .icon-eye-off {
    display: none;
}

.auth-modal-password-toggle.is-visible .icon-eye {
    display: none;
}

.auth-modal-password-toggle.is-visible .icon-eye-off {
    display: block;
}

/* Plus de padding-right sur le champ password pour accueillir œil + clé */
.auth-modal-field--password input {
    padding-right: 110px;
}

/* Placeholders en banana, taille intermédiaire */
#auth-modal-overlay .auth-modal-field input::placeholder {
    font-family: var(--font-head);
    font-size: 1.75rem;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.65);
}

/* Bouton "Se connecter" — body font, texte blanc */
#auth-modal-overlay .auth-modal-btn {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    padding: 12px 0;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

#auth-modal-overlay .auth-modal-btn:hover {
    opacity: 1;
    background: var(--purple);
    color: #fff;
    border-color: var(--green);
}

/* Ligne de liens sous le bouton — aux extrémités, alignés avec les inputs */
.login-tab-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    padding: 0 6px;
}

/* Réseaux sociaux */
.links-social-login {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 30px 0 0;
}

.social-icon {
    transition: opacity 0.15s ease;
}

.social-icon:hover {
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-modal-container {
        padding: 24px 20px;
    }

    .login-tab-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .login-tab-left .icon-account-login {
        width: 120px;
        height: 120px;
    }
}
