/* --- VARIABLES & RESET --- */
:root {
    --primary: #ff4b2b;
    --primary-gradient: linear-gradient(to right, #ff416c, #ff4b2b);
    --bg-color: #f0f2f5;
    --text-dark: #333;
    --text-light: #777;
    --border-color: #e4e6eb;
    --blue: #007bff;
    --pink: #ff69b4;
    --purple: #9b59b6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.auth-page {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* --- CARTE D'INSCRIPTION --- */
.auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* --- GROUPES D'ENTRÉE --- */
.input-group-auth {
    margin-bottom: 1.5rem;
    position: relative;
}

.input-group-auth label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #444;
}

.input-group-auth input[type="text"],
.input-group-auth input[type="password"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group-auth input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 75, 43, 0.1);
}

/* --- SÉLECTEUR DE GENRE (GRID) --- */
.gender-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 0.5rem;
}

.gender-radio { display: none; }

.gender-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fdfdfd;
}

.gender-btn i {
    font-size: 1.5rem;
    color: #bcc0c4;
    margin-bottom: 4px;
}

/* --- EFFETS AU CLIC (CHECKED) --- */

/* Homme */
#g1:checked + .label-man {
    border-color: var(--blue);
    background: rgba(0, 123, 255, 0.08);
}
#g1:checked + .label-man i { color: var(--blue); }

/* Femme */
#g2:checked + .label-woman {
    border-color: var(--pink);
    background: rgba(255, 105, 180, 0.08);
}
#g2:checked + .label-woman i { color: var(--pink); }

/* Trans */
#g3:checked + .label-trans {
    border-color: var(--purple);
    background: rgba(155, 89, 182, 0.08);
}
#g3:checked + .label-trans i { color: var(--purple); }

/* Couple */
#g4:checked + .label-couple {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box, 
                linear-gradient(to right, var(--blue), var(--pink)) border-box;
}
#g4:checked + .label-couple i {
    background: linear-gradient(to right, var(--blue), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- AUTOCOMPLÉTION --- */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    display: none;
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
}

.suggestion-item strong {
    color: #ff4b2b; /* Code postal en rouge pour bien le voir */
    margin-right: 8px;
    font-family: monospace;
}

.suggestion-item:hover { background: #f5f7f8; }


/* --- BOUTON VALIDER (DÉGRADÉ TINDER) --- */
.btn-auth {
    width: 100%;
    padding: 1rem;
    margin-top: 1.5rem;
    border: none;
    border-radius: 12px;
    background: var(--primary-gradient);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 75, 43, 0.2);
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 75, 43, 0.3);
    filter: brightness(1.1);
}

.btn-auth:active { transform: translateY(0); }

/* --- FOOTER --- */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.auth-footer a:hover { text-decoration: underline; }

/* Style des suggestions de pseudo */
#username-status {
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.4;
}

.suggest-link {
    color: #ff4b2b !important; /* Rouge Tinder */
    text-decoration: none !important;
    font-weight: bold !important;
    margin-right: 10px;
    display: inline-block;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(255, 75, 43, 0.1); /* Léger fond pour cliquer plus facilement */
    transition: all 0.2s;
}

.suggest-link:hover {
    background: #ff4b2b;
    color: white !important;
}

/* Barre de force */
.password-strength-meter {
    height: 5px;
    background-color: #eee;
    margin-top: 8px;
    border-radius: 3px;
    overflow: hidden;
}

#strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
}

/* Liste des critères */
.password-criteria {
    list-style: none;
    padding: 0;
    margin-top: 10px;
    font-size: 11px;
}

.password-criteria li {
    color: #999;
    margin-bottom: 3px;
    transition: color 0.3s;
}

.password-criteria li::before {
    content: "✖ ";
    margin-right: 5px;
}

.password-criteria li.valid {
    color: #2ecc71; /* Vert */
}

.password-criteria li.valid::before {
    content: "✔ ";
}

/* Couleurs de la barre */
.strength-weak { width: 33% !important; background-color: #e74c3c !important; }
.strength-medium { width: 66% !important; background-color: #f1c40f !important; }
.strength-strong { width: 100% !important; background-color: #2ecc71 !important; }

.password-wrapper {
    display: flex;
    align-items: center;
}

.toggle-password {
    position: absolute;
    right: 15px;
    cursor: pointer;
    color: #999;
    font-size: 1.1rem;
    z-index: 10;
    transition: color 0.3s;
}

.toggle-password:hover {
    color: #ff4b2b;
}

/* On ajoute un peu de padding à droite de l'input pour que le texte ne passe pas sous l'œil */
#password {
    padding-right: 45px !important;
}

/* --- ALERTES & MESSAGES --- */
.alert {
    padding: 12px 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    border: 1px solid transparent;
    animation: fadeInDown 0.3s ease;
}

.alert-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}