/* --- VARIABLES & DESIGN SYSTEM --- */
:root {
    --primary: #e63946;
    --primary-hover: #d62828;
    --secondary: #2ecc71;
    --bg-light: #f8f9fa;
    --text-main: #333;
    --text-muted: #666;
    --border: #eee;
    --white: #ffffff;
    --shadow: 0 15px 35px rgba(230, 57, 70, 0.1);
}

/* --- RESET & BASES --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: 'Segoe UI', Roboto, sans-serif; 
    background-color: var(--bg-light); 
    color: var(--text-main);
    line-height: 1.5;
}

/* --- PAGE D'ACCUEIL (INDEX.PHP) --- */
.home-page { 
    background: var(--white); 
    height: 100vh; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
}
.home-container { max-width: 900px; padding: 20px; }
.logo-large { font-size: 5rem; margin-bottom: 20px; display: block; }
.hero-section h1 { font-size: 3rem; margin-bottom: 15px; }
.hero-section h1 span { color: var(--primary); }
.hero-section p { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 40px; }

.home-actions { display: flex; gap: 20px; justify-content: center; margin-bottom: 60px; }
.btn-home { 
    padding: 15px 35px; 
    border-radius: 50px; 
    text-decoration: none; 
    font-weight: 700; 
    font-size: 1.1rem; 
    transition: 0.3s; 
}
.login-btn { border: 2px solid var(--primary); color: var(--primary); }
.login-btn:hover { background: var(--primary); color: var(--white); }
.register-btn { background: var(--primary); color: var(--white); box-shadow: 0 10px 20px rgba(230, 57, 70, 0.2); }

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 40px; }
.feature-item { padding: 20px; border-radius: 15px; background: #fdfdfd; border: 1px solid #f0f0f0; }

/* --- PAGES AUTH (LOGIN/REGISTER) --- */
.auth-page { 
    background: linear-gradient(135deg, #fdf0f1 0%, #ffffff 100%); 
    min-height: 100vh; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: 20px;
}
.auth-card { 
    background: var(--white); 
    padding: 40px; 
    border-radius: 24px; 
    width: 100%;
    max-width: 420px; 
    box-shadow: var(--shadow); 
    text-align: center; 
}

/* --- GROUPES D'ENTRÉE (UNIFIÉ) --- */
.input-group-auth { margin-bottom: 20px; text-align: left; position: relative; }
.input-group-auth label { 
    display: block;
    font-size: 0.85rem; 
    font-weight: 600; 
    color: #555; 
    margin-bottom: 8px;
    margin-left: 5px; 
}
.input-group-auth input { 
    width: 100%; 
    padding: 12px 15px; 
    border-radius: 12px; 
    border: 1px solid var(--border); 
    background: #f9f9f9; 
    outline: none; 
    font-size: 1rem;
    transition: 0.3s; 
}
.input-group-auth input:focus { 
    border-color: var(--primary); 
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

/* --- SÉLECTEUR DE GENRE --- */
.gender-selector { display: flex; gap: 10px; margin-top: 5px; }
.gender-radio { display: none; }
.gender-btn { 
    flex: 1; border: 2px solid var(--border); border-radius: 12px; 
    padding: 12px; text-align: center; cursor: pointer; transition: 0.3s; color: #ccc;
}
.gender-btn i { font-size: 1.2rem; }

#g1:checked + .label-man { border-color: #007bff; color: #007bff; background: rgba(0,123,255,0.05); }
#g2:checked + .label-woman { border-color: #ff69b4; color: #ff69b4; background: rgba(255,105,180,0.05); }
#g3:checked + .label-trans { border-color: #9b59b6; color: #9b59b6; background: rgba(155,89,182,0.05); }
#g4:checked + .label-couple { 
    border-color: var(--primary); color: var(--text-main); 
    background: linear-gradient(to right, rgba(0,123,255,0.05), rgba(255,105,180,0.05));
}

/* --- BOUTONS AUTH --- */
.btn-auth { 
    width: 100%; padding: 14px; border: none; border-radius: 12px; 
    font-weight: 700; font-size: 1rem; cursor: pointer; color: var(--white); 
    transition: 0.3s; margin-top: 10px;
}
.main-btn { background: var(--primary); }
.main-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }
.reg-btn { background: var(--secondary); }
.reg-btn:hover { opacity: 0.9; transform: translateY(-2px); }

/* --- SUGGESTIONS & STATUTS --- */
#username-status { font-size: 0.8rem; margin-top: 5px; }
.suggest-link { 
    color: var(--primary) !important; font-weight: bold; 
    text-decoration: underline; margin-right: 8px; cursor: pointer; 
}

.suggestions-list { 
    position: absolute; width: 100%; background: white; 
    border: 1px solid var(--border); border-radius: 0 0 12px 12px; 
    z-index: 10; max-height: 150px; overflow-y: auto; display: none; 
}
.suggestion-item { padding: 10px; cursor: pointer; border-bottom: 1px solid var(--border); }
.suggestion-item:hover { background: #f8f8f8; }

/* --- MOT DE PASSE --- */
.password-wrapper { position: relative; }
.toggle-password { 
    position: absolute; right: 15px; top: 50%; transform: translateY(-50%); 
    cursor: pointer; color: #999; 
}
.password-strength-meter { height: 4px; background: #eee; margin-top: 8px; border-radius: 2px; }
#strength-bar { height: 100%; width: 0; transition: 0.3s; border-radius: 2px; }
.strength-weak { background: #ff4d4d; width: 33% !important; }
.strength-medium { background: #ffbd3d; width: 66% !important; }
.strength-strong { background: #2ecc71; width: 100% !important; }

.password-criteria { list-style: none; font-size: 0.75rem; margin-top: 10px; color: #999; }
.password-criteria li.valid { color: var(--secondary); }

/* --- FOOTER --- */
.auth-footer { margin-top: 25px; font-size: 0.9rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }


/* --- 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); }
}