/* ============================================================
   membres.css — Styles pages membres (auth + dashboard)
   ============================================================ */

/* ---- PAGES AUTH (login, inscription, reset) ------------ */
.auth-page {
    min-height: calc(100vh - var(--nav-h) - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: var(--c-bg);
}

.auth-card {
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-md);
}

.auth-card-wide { max-width: 560px; }

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    text-decoration: none;
}

.auth-logo-name {
    font-family: var(--font-title);
    font-size: 16px;
    font-weight: 700;
    color: var(--c-primary);
}

.auth-title {
    font-family: var(--font-title);
    font-size: 22px;
    font-weight: 700;
    color: var(--c-primary);
    margin-bottom: 6px;
}

.auth-sub {
    font-size: 14px;
    color: var(--c-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}

.auth-error-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #FED7D7;
    color: #9B2C2C;
    border-radius: var(--r-md);
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

.auth-success-box {
    background: #C6F6D5;
    color: #276749;
    border-radius: var(--r-md);
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

.auth-form    { display: flex; flex-direction: column; gap: 0; }

.form-field   { margin-bottom: 14px; }

.form-label   {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--c-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
}

.form-forgot {
    font-size: 12px;
    color: var(--c-accent);
}

.req { color: #E53E3E; }

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    font-size: 14px;
    color: var(--c-text);
    background: var(--c-white);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-family: var(--font-body);
}

.form-input:focus {
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(56,178,172,.12);
}

.form-input-error { border-color: #FC8181; }
.form-input-error:focus { border-color: #E53E3E; box-shadow: 0 0 0 3px rgba(229,62,62,.1); }

.form-input-disabled {
    background: var(--c-bg);
    color: var(--c-muted);
    cursor: not-allowed;
}

.form-error { display: block; font-size: 12px; color: #E53E3E; margin-top: 4px; }
.form-hint  { display: block; font-size: 12px; color: var(--c-muted); margin-top: 4px; }
.form-note  { font-size: 12px; color: var(--c-muted); text-align: center; margin-top: 8px; }

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

.input-password-wrap .form-input { padding-right: 44px; }

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--c-muted);
    padding: 0;
    line-height: 1;
}

/* Indicateur force mot de passe */
.password-strength {
    height: 4px;
    background: var(--c-border);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width .3s, background .3s;
}

.strength-label {
    font-size: 11px;
    font-weight: 500;
    margin-top: 3px;
    display: block;
}

/* Remember + CGU */
.remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--c-muted);
    cursor: pointer;
    margin-bottom: 14px;
}

.cgu-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--c-text);
    cursor: pointer;
    line-height: 1.5;
}

.cgu-label a    { color: var(--c-accent); }
.cgu-error      { color: #E53E3E; }

/* Boutons auth */
.btn-auth {
    width: 100%;
    padding: 12px;
    background: var(--c-primary);
    color: #F7FAFC;
    border: none;
    border-radius: var(--r-md);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-title);
    cursor: pointer;
    transition: background .15s, transform .1s;
    margin-top: 4px;
}

.btn-auth:hover  { background: #1A202C; }
.btn-auth:active { transform: scale(.98); }

.btn-danger {
    padding: 10px 20px;
    background: #E53E3E;
    color: #fff;
    border: none;
    border-radius: var(--r-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.btn-danger:hover { background: #C53030; }

.btn-auth-wa {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px;
    background: #25D366;
    color: #fff;
    border-radius: var(--r-md);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s;
    margin-bottom: 16px;
}

.btn-auth-wa:hover { background: #20bf5b; }

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--c-muted);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--c-border);
}

.auth-switch {
    text-align: center;
    font-size: 14px;
    color: var(--c-muted);
    margin-top: 16px;
}

.auth-switch a { color: var(--c-accent); font-weight: 500; }

/* Avantages inscription */
.inscription-avantages {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.avantage-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--c-muted);
}

.avantage-icon { color: var(--c-cta); font-weight: 700; }

/* Grid 2 colonnes dans formulaire */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ---- DASHBOARD ----------------------------------------- */
.dashboard-page {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - var(--nav-h));
    align-items: start;
}

/* Sidebar dashboard */
.dashboard-sidebar {
    background: var(--c-white);
    border-right: 1px solid var(--c-border);
    min-height: calc(100vh - var(--nav-h));
    padding: 24px 16px;
    position: sticky;
    top: var(--nav-h);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ds-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--c-border);
}

.ds-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--c-primary);
    color: #F7FAFC;
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ds-user-nom  { font-family: var(--font-title); font-size: 15px; font-weight: 600; color: var(--c-primary); }
.ds-badge-premium { background: var(--c-accent); color: #085041; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.ds-badge-free    { background: var(--c-bg); color: var(--c-muted); font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 20px; border: 1px solid var(--c-border); }

.ds-nav       { display: flex; flex-direction: column; gap: 2px; }
.ds-nav-link  { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-md); font-size: 14px; color: var(--c-muted); transition: all .15s; font-weight: 500; }
.ds-nav-link:hover    { background: var(--c-bg); color: var(--c-primary); }
.ds-nav-active        { background: #E1F5EE; color: var(--c-accent); }
.ds-nav-premium       { color: var(--c-accent); font-weight: 600; }
.ds-nav-logout        { color: #E53E3E; margin-top: 8px; }
.ds-nav-logout:hover  { background: #FED7D7; }

.ds-premium-cta {
    background: var(--c-primary);
    border-radius: var(--r-lg);
    padding: 16px;
    color: #A0AEC0;
    margin-top: auto;
}

.ds-premium-cta .ds-premium-badge {
    background: var(--c-accent);
    color: #085041;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 10px;
}

.ds-premium-cta h3 { font-family: var(--font-title); font-size: 14px; font-weight: 700; color: #F7FAFC; margin-bottom: 6px; }
.ds-premium-cta p  { font-size: 12px; line-height: 1.5; margin-bottom: 10px; }
.ds-premium-prix   { font-family: var(--font-title); font-size: 18px; font-weight: 700; color: var(--c-accent); margin-bottom: 12px; }
.ds-premium-prix span { font-size: 12px; font-weight: 400; color: #718096; }

.ds-premium-active {
    background: #E1F5EE;
    border-radius: var(--r-md);
    padding: 10px 14px;
    font-size: 13px;
    color: #0F6E56;
    font-weight: 600;
    margin-top: auto;
}

.ds-premium-expiry { font-size: 12px; color: var(--c-muted); font-weight: 400; margin-top: 4px; }

/* Contenu principal dashboard */
.dashboard-main {
    padding: 28px 32px;
    background: var(--c-bg);
    min-height: calc(100vh - var(--nav-h));
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-title { font-family: var(--font-title); font-size: 22px; font-weight: 700; color: var(--c-primary); margin-bottom: 4px; }
.dashboard-sub   { font-size: 13px; color: var(--c-muted); }

/* Statistiques */
.dash-stats    { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 24px; }
.dash-stat-card { background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 16px; display: flex; align-items: center; gap: 14px; }
.dash-stat-icon { width: 40px; height: 40px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.dash-stat-num  { font-family: var(--font-title); font-size: 20px; font-weight: 700; color: var(--c-primary); }
.dash-stat-label { font-size: 12px; color: var(--c-muted); }

/* Sections */
.dash-section       { margin-bottom: 24px; }
.dash-section-title { font-family: var(--font-title); font-size: 16px; font-weight: 700; color: var(--c-primary); margin-bottom: 14px; }

/* Grille 2 colonnes */
.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }

/* Cards génériques */
.dash-card          { background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 20px; margin-bottom: 16px; }
.dash-card:last-child { margin-bottom: 0; }
.dash-card-header   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dash-card-title    { font-family: var(--font-title); font-size: 15px; font-weight: 700; color: var(--c-primary); }
.dash-card-link     { font-size: 13px; color: var(--c-accent); }

/* Listes dans les cards */
.dash-list      { display: flex; flex-direction: column; gap: 1px; }
.dash-list-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--c-border); text-decoration: none; transition: background .1s; }
.dash-list-item:last-child { border-bottom: none; }
.dash-list-item:hover { background: var(--c-bg); border-radius: var(--r-sm); padding-left: 6px; }
.dash-list-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dash-list-text { flex: 1; min-width: 0; }
.dash-list-titre { font-size: 13px; font-weight: 500; color: var(--c-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-list-meta  { font-size: 11px; color: var(--c-muted); margin-top: 2px; }
.dash-list-check { flex-shrink: 0; font-size: 14px; }
.dash-list-status { flex-shrink: 0; font-size: 11px; font-weight: 500; }
.status-resolu { color: var(--c-cta); }
.status-ouvert { color: #EF9F27; }

/* État vide */
.dash-empty { text-align: center; padding: 24px 16px; }
.dash-empty p { font-size: 14px; color: var(--c-muted); margin-bottom: 12px; }

/* Progression */
.progression-grid  { display: flex; flex-direction: column; gap: 12px; }
.prog-item         { background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--r-md); padding: 12px 16px; }
.prog-item-header  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.prog-cat          { font-size: 13px; }
.prog-count        { font-size: 12px; color: var(--c-muted); }
.prog-bar-track    { height: 6px; background: var(--c-border); border-radius: 3px; overflow: hidden; }
.prog-bar-fill     { height: 100%; border-radius: 3px; transition: width .5s ease; }
.prog-pct          { font-size: 11px; color: var(--c-muted); margin-top: 4px; text-align: right; }

/* Recommandés */
.recommandes-grid  { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.recommande-card   { display: block; background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--r-lg); overflow: hidden; transition: box-shadow .15s; }
.recommande-card:hover { box-shadow: var(--shadow-md); }
.recommande-bar    { height: 3px; }
.recommande-body   { padding: 12px 14px; }
.recommande-top    { display: flex; justify-content: space-between; margin-bottom: 6px; }
.recommande-titre  { font-family: var(--font-title); font-size: 13px; font-weight: 600; color: var(--c-primary); line-height: 1.4; margin-bottom: 8px; }
.recommande-meta   { font-size: 11px; color: var(--c-muted); }

/* Abonnement actif */
.dash-abonnement {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--c-white);
    border: 1px solid #9FE1CB;
    border-radius: var(--r-lg);
    padding: 16px 20px;
    margin-bottom: 24px;
}
.dash-abonnement-icon { font-size: 24px; color: var(--c-accent); }
.dash-abonnement-info { flex: 1; }
.dash-abonnement-info h3 { font-family: var(--font-title); font-size: 15px; font-weight: 700; color: var(--c-primary); margin-bottom: 4px; }
.dash-abonnement-info p  { font-size: 13px; color: var(--c-muted); }

/* ---- PROFIL -------------------------------------------- */
.profil-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.profil-card-main   { margin-bottom: 0; }
.profil-card-status { margin-bottom: 16px; }

.profil-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: var(--c-muted);
    font-size: 13px;
    font-weight: 500;
}

.profil-separator::before,
.profil-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--c-border);
}

.profil-actions { display: flex; gap: 12px; margin-top: 8px; }

.profil-status-items { display: flex; flex-direction: column; gap: 12px; }
.profil-status-item  { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--c-border); font-size: 14px; }
.profil-status-item:last-child { border-bottom: none; }
.profil-status-label { color: var(--c-muted); }
.profil-status-value { font-weight: 500; color: var(--c-primary); }

.profil-abo      { }
.profil-abo-type { font-family: var(--font-title); font-size: 15px; font-weight: 700; color: var(--c-accent); margin-bottom: 8px; }
.profil-abo-dates { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--c-muted); }

/* Paiements */
.paiements-list  { display: flex; flex-direction: column; gap: 1px; }
.paiement-item   { display: flex; justify-content: space-between; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--c-border); }
.paiement-item:last-child { border-bottom: none; }
.paiement-ref    { font-family: monospace; font-size: 13px; font-weight: 600; color: var(--c-primary); }
.paiement-meta   { font-size: 12px; color: var(--c-muted); margin-top: 2px; }
.paiement-right  { text-align: right; }
.paiement-montant { font-size: 14px; font-weight: 600; color: var(--c-primary); }
.paiement-statut { font-size: 11px; margin-top: 3px; }
.paiement-statut-verifie    { color: var(--c-cta); }
.paiement-statut-en_attente { color: #EF9F27; }
.paiement-statut-rejete     { color: #E53E3E; }

/* Danger zone */
.profil-danger      { border-color: #FC8181; }
.profil-danger-desc { font-size: 14px; color: var(--c-muted); margin-bottom: 14px; line-height: 1.6; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 16px;
}

.modal-box {
    background: var(--c-white);
    border-radius: var(--r-xl);
    padding: 28px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-md);
}

.modal-title { font-family: var(--font-title); font-size: 18px; font-weight: 700; color: var(--c-primary); margin-bottom: 10px; }
.modal-desc  { font-size: 14px; color: var(--c-muted); line-height: 1.6; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.access-free    { color: var(--c-cta); }
.access-premium { color: #854F0B; }

/* ---- RESPONSIVE ---------------------------------------- */
@media (max-width: 900px) {
    .dashboard-page   { grid-template-columns: 1fr; }
    .dashboard-sidebar {
        position: static;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--c-border);
        flex-direction: row;
        flex-wrap: wrap;
        padding: 16px;
    }
    .ds-user       { border-bottom: none; padding-bottom: 0; }
    .ds-nav        { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .ds-nav-link   { padding: 6px 12px; font-size: 13px; }
    .ds-premium-cta { display: none; }
    .dashboard-main { padding: 20px 16px; }
    .dash-stats    { grid-template-columns: repeat(2,1fr); }
    .dash-grid-2   { grid-template-columns: 1fr; }
    .profil-grid   { grid-template-columns: 1fr; }
    .recommandes-grid { grid-template-columns: 1fr 1fr; }
    .form-row-2    { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .auth-card     { padding: 24px 16px; }
    .dash-stats    { grid-template-columns: 1fr 1fr; }
    .recommandes-grid { grid-template-columns: 1fr; }
}
