/* --- Reset box-sizing --- */
*, *::before, *::after {
    box-sizing: border-box;
}

/* --- Body --- */
body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Logo --- */
.logo {
    font-family: 'Arial Black', sans-serif;
    font-size: 38px;
    color: var(--primary);
    letter-spacing: 4px;
    margin-bottom: 15px;
}

.user-logo {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
}

/* --- Container --- */
body.user {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.user-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 40px 50px;
    width: 450px;
    max-width: 100%;
    text-align: center;
    box-shadow: 0 0 20px rgba(255,255,255,0.1);
    transition: box-shadow 0.3s ease-in-out;
}

.user-container:hover {
    box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.3);
}

/* --- Inputs --- */
.user-input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 10px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 14px;
    outline: none;
    transition: background 0.3s;
}

.user-input:focus {
    background: rgba(255,255,255,0.2);
}

/* --- Se souvenir de moi --- */

.remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* --- Buttons --- */
.user-button {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    color: white;
    font-weight: bold;
    font-size: 15px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.user-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.5);
}

/* --- Messages --- */
.user-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.user-message.error {
    background: rgba(232, 33, 39, 0.1);
    border: 1px solid rgba(232, 33, 39, 0.3);
    color: #ff6b6b;
}

.user-message.success {
    background: rgba(0, 179, 134, 0.1);
    border: 1px solid rgba(0, 179, 134, 0.3);
    color: #00b386;
}

.user-message a {
    color: #00b386;
    text-decoration: underline;
    font-weight: bold;
}

.user-message a:hover {
    color: #00d4a0;
}

.user-message {
    animation: slideDown 0.3s ease-out;
}


/* --- Links --- */
.user-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
}

.user-link:hover { text-decoration: underline; }

a.user-password,
a.user-password:link,
a.user-password:visited,
a.user-password:active {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

a.user-password:hover {
    text-decoration: underline;
}

.password-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    padding-right: 42px;
    box-sizing: border-box;
}

/* Bouton œil — toggle affichage mot de passe */
.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-60%); /* -60% compense le margin-bottom de .user-input */
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #888);
    opacity: 0.55;
    transition: opacity 0.2s ease, color 0.2s ease;
    border-radius: 4px;
    line-height: 0;
}

.toggle-password:hover {
    opacity: 1;
    color: var(--primary, var(--primary));
}

.toggle-password:focus-visible {
    outline: 2px solid var(--primary, var(--primary));
    outline-offset: 2px;
}

#password-valid-icon,
#confirm-valid-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #26FF00;
    font-size: 18px;
}

#confirm-invalid-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: red;
    font-size: 18px;
}

.hidden {
    display: none;
}

/* Conteneur principal */
.password-strength {
    width: 100%;
    height: 20px;                  
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
    margin-bottom: 10px;
}

/* Fond de la barre */
#strength-background {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
}

/* Barre de progression dynamique */
#strength-bar {
    width: 0%;
    height: 100%;
    border-radius: 8px;
    background-color: white;
    transition: width 0.3s ease-in-out, background-color 0.3s;
    display: flex;
    align-items: center;           
    justify-content: center;       
    font-size: 14px;
    line-height: 1;                
    color: black;
    font-weight: bold;
    padding: 0;
    box-sizing: border-box;
}

/* --- RESPONSIVE --- */

/* Tablettes et petits laptops */
@media (max-width: 1024px) {
    .user-container {
        padding: 35px 40px;
        width: 420px;
    }
    
    .logo {
        font-size: 34px;
    }
}

/* Tablettes portrait */
@media (max-width: 768px) {
    body.user {
        padding: 15px;
    }
    
    .user-container {
        padding: 30px 35px;
        width: 100%;
        max-width: 500px;
    }
    
    .logo {
        font-size: 32px;
        letter-spacing: 3px;
    }
    
    .user-input {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .user-button {
        padding: 14px;
        font-size: 16px;
    }
}

/* Smartphones */
@media (max-width: 480px) {
    body.user {
        padding: 10px;
    }
    
    .user-container {
        padding: 24px 20px;
        border-radius: 12px;
    }
    
    .logo {
        font-size: 28px;
        letter-spacing: 2px;
        margin-bottom: 12px;
    }
    
    .user-input {
        padding: 14px 16px;
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .user-button {
        padding: 14px;
        font-size: 16px;
        min-height: 48px;
    }
    
    .user-message {
        padding: 14px 18px;
        font-size: 15px;
    }
    
    .password-strength {
        height: 24px;
    }
    
    #strength-bar {
        font-size: 13px;
    }
    
    #password-valid-icon,
    #confirm-valid-icon,
    #confirm-invalid-icon {
        font-size: 20px;
        right: 12px;
    }
}

/* Très petits smartphones */
@media (max-width: 360px) {
    .user-container {
        padding: 20px 16px;
    }
    
    .logo {
        font-size: 24px;
    }
    
    .user-input {
        font-size: 15px;
    }
    
    .user-button {
        font-size: 15px;
    }
}
/* ===== CRITÈRES MOT DE PASSE (VALIDATION DYNAMIQUE) ===== */

.password-requirements {
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    font-size: 13px;
}

.req-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.req-item:last-child {
    margin-bottom: 0;
}

.req-icon {
    font-size: 16px;
    min-width: 20px;
    text-align: center;
}

.req-text {
    color: #ccc;
    flex: 1;
}


/* États des critères */
.req-item.pending .req-icon {
    /* ⚪ Gris par défaut - visible */
}

/* Cacher le ⚪ quand on affiche ❌ ou ✅ */
.req-item.invalid .req-icon,
.req-item.valid .req-icon {
    font-size: 0; /* Cache le texte ⚪ */
}

.req-item.invalid .req-icon::before {
    content: "❌";
    font-size: 16px; /* Affiche seulement l'icône */
}

.req-item.invalid .req-text {
    color: #ff6b6b;
}

.req-item.valid .req-icon::before {
    content: "✅";
    font-size: 16px; /* Affiche seulement l'icône */
}

.req-item.valid .req-text {
    color: #00b386;
    font-weight: 600;
}

/* Animation */
.req-item {
    animation: userSlideIn 0.3s ease-out;
}

@keyframes userSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .password-requirements {
        padding: 14px 18px;
        font-size: 14px;
    }
    
    .req-icon {
        font-size: 18px;
    }
}

/* Différencier obligatoire vs recommandé */
.req-item.required strong {
    color: #e82127;
    font-weight: 700;
}

.req-item:not(.required) .req-text {
    opacity: 0.85;
}

/* Pour les recommandés validés, ne pas forcer le vert vif */
.req-item:not(.required).valid .req-text {
    color: #00b386;
    opacity: 0.7;
}

/* ===== CRITÈRES OBLIGATOIRES VS RECOMMANDÉS (CORRIGÉ) ===== */

/* Tous les critères obligatoires en rouge vif */
.req-item.required .req-text {
    color: #fff;
}

/* Seulement le recommandé en gris */
.req-item:not(.required) .req-text {
    color: #ccc;
    opacity: 0.85;
}

/* Obligatoires validés : vert vif */
.req-item.required.valid .req-text {
    color: #00b386;
    font-weight: 600;
}

/* Recommandé validé : vert pâle */
.req-item:not(.required).valid .req-text {
    color: #00b386;
    opacity: 0.7;
}

/* =========================================
   THEME OVERRIDES — USER PAGES
   Harmonisation avec dashboard
========================================= */

/* Container aligné sur les cards dashboard */
body.user .user-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    backdrop-filter: none;
}

/* Hover cohérent */
body.user .user-container:hover {
    box-shadow: var(--shadow-lg);
}

/* Inputs alignés thème */
body.user .user-input {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

body.user .user-input::placeholder {
    color: var(--text-placeholder);
}

body.user .user-input:focus {
    background: var(--bg-input-focus);
    border-color: var(--border-color-focus);
}

/* Textes */
body.user h2 {
    color: var(--text-primary);
}

body.user p,
body.user label,
body.user span {
    color: var(--text-secondary);
}

/* Lien mot de passe */
body.user .user-password {
    color: var(--text-secondary);
}

body.user .user-password:hover {
    color: var(--text-primary);
}

/* Messages */
body.user .user-message.success {
    background: rgba(0, 179, 134, 0.12);
    border-color: rgba(0, 179, 134, 0.4);
}

body.user .user-message.error {
    background: rgba(232, 33, 39, 0.12);
    border-color: rgba(232, 33, 39, 0.4);
}

/* =========================
   MODE CLAIR — CONTRASTE
========================= */

[data-theme="light"] body.user .user-container {
    background: #d9e1ea;
    border: 2px solid rgba(13, 17, 23, 0.2);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

[data-theme="light"] body.user .user-input {
    background: #c5d0dd;
    border: 2px solid rgba(13, 17, 23, 0.25);
    color: #0d1117;
}

[data-theme="light"] body.user .user-input:focus {
    background: #b8c4d2;
    border-color: #007d5e;
    box-shadow: 0 0 0 4px rgba(0, 125, 94, 0.15);
}

[data-theme="light"] body.user h2 {
    color: #0d1117;
    font-weight: 800;
}

[data-theme="light"] body.user p,
[data-theme="light"] body.user label,
[data-theme="light"] body.user span {
    color: #1f2937;
}

/* Password strength */
[data-theme="light"] .password-strength {
    background: rgba(13, 17, 23, 0.08);
}

/* Password requirements */
[data-theme="light"] .password-requirements {
    background: rgba(13, 17, 23, 0.04);
    border: 2px solid rgba(13, 17, 23, 0.15);
}

/* =========================================
   MODE CLAIR — CRITÈRES MOT DE PASSE
========================================= */

/* Obligatoires : NOIR lisible */
[data-theme="light"] .req-item.required .req-text {
    color: #0d1117 !important;
    font-weight: 600;
}

/* Recommandés : GRIS FONCÉ */
[data-theme="light"] .req-item:not(.required) .req-text {
    color: #374151 !important;
    opacity: 0.9;
}

/* Icône neutre (⚪) visible en clair */
[data-theme="light"] .req-item.pending .req-icon {
    color: #6b7280;
}

/* ❌ invalide */
[data-theme="light"] .req-item.invalid .req-text {
    color: #b91c1c !important;
}

/* ✅ valide obligatoire */
[data-theme="light"] .req-item.required.valid .req-text {
    color: #007d5e !important;
    font-weight: 700;
}

/* ✅ valide recommandé */
[data-theme="light"] .req-item:not(.required).valid .req-text {
    color: #007d5e !important;
    opacity: 0.75;
}

/* Styles du choix du type de compte (register.php)
   (déplacé depuis le style inline de la page — contenu inchangé) */
    .account-type-selector { display:flex; gap:12px; margin-bottom:20px; }
    .account-type-option { flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; padding:16px 12px; border:2px solid var(--border-color,#e5e7eb); border-radius:12px; cursor:pointer; transition:all 0.2s ease; background:var(--bg-input,#fff); }
    .account-type-option:hover { border-color:var(--primary); background:rgba(var(--primary-rgb),0.05); }
    .account-type-option.active { border-color:var(--primary); background:rgba(var(--primary-rgb),0.08); }
    .account-type-icon { font-size:28px; }
    .account-type-label { font-weight:700; font-size:14px; color:var(--text-primary,#111827); }
    .account-type-desc { font-size:11px; color:var(--text-muted,#6b7280); }
    .pro-info-box { background:rgba(var(--primary-rgb),0.08); border:1px solid rgba(var(--primary-rgb),0.2); border-radius:8px; padding:10px 14px; font-size:12px; color:var(--text-secondary,#4b5563); margin-bottom:12px; line-height:1.5; }
