/* =============================================
   Plugin Membres - Styles Frontend
   ============================================= */

/* Container principal des formulaires */
.membres-form-container {
    max-width: 480px;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    padding: 40px;
    border: 1px solid #eee;
}

.membres-form-container h2 {
    text-align: center;
    margin: 0 0 25px;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.membres-form-container h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 20px 0 5px;
}

/* Champs de formulaire */
.membres-field {
    margin-bottom: 18px;
}

.membres-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #444;
}

.membres-field input[type="text"],
.membres-field input[type="email"],
.membres-field input[type="password"],
.membres-field input[type="url"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: #fafafa;
}

.membres-field input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    background: #fff;
}

/* Ligne de champs côte à côte */
.membres-field-row {
    display: flex;
    gap: 15px;
}

.membres-field-row .membres-field {
    flex: 1;
}

/* Checkbox */
.membres-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
}

.membres-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #0073aa;
}

/* Toggle afficher/masquer mot de passe */
.membres-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.membres-password-wrapper input {
    padding-right: 44px !important;
}

.membres-toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: color 0.2s;
    line-height: 1;
}

.membres-toggle-password:hover {
    color: #555;
}

.membres-toggle-password svg {
    width: 18px;
    height: 18px;
}

/* Version compacte pour le widget */
.membres-widget .membres-toggle-password svg {
    width: 16px;
    height: 16px;
}

/* Bouton principal */
.membres-btn {
    width: 100%;
    padding: 13px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 5px;
}

.membres-btn:hover {
    background: #005a87;
}

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

.membres-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Messages */
.membres-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.membres-message--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.membres-message--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Liens sous les formulaires */
.membres-links {
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
    color: #666;
}

.membres-links a {
    color: #0073aa;
    text-decoration: none;
}

.membres-links a:hover {
    text-decoration: underline;
}

.membres-separator {
    margin: 0 10px;
    color: #ccc;
}

.membres-separator-line {
    border: none;
    border-top: 1px solid #eee;
    margin: 30px 0 20px;
}

/* Indicateur de force du mot de passe */
.membres-password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 8px;
    transition: all 0.3s;
    opacity: 0;
}

.membres-password-strength.weak {
    background: #e74c3c;
    width: 33%;
}

.membres-password-strength.medium {
    background: #f39c12;
    width: 66%;
}

.membres-password-strength.strong {
    background: #27ae60;
    width: 100%;
}

/* Info texte */
.membres-info {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.membres-hint {
    color: #888;
    font-size: 13px;
    margin: 0 0 15px;
}

/* Avatar */
.membres-avatar-section {
    text-align: center;
    margin-bottom: 25px;
}

.membres-avatar-section img {
    border-radius: 50%;
    border: 3px solid #eee;
}

.membres-avatar-info {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

.membres-avatar-info a {
    color: #0073aa;
    text-decoration: none;
}

/* =============================================
   Dashboard
   ============================================= */

.membres-dashboard {
    max-width: 700px;
    margin: 40px auto;
}

.membres-dashboard-header {
    text-align: center;
    margin-bottom: 35px;
}

.membres-dashboard-header h2 {
    margin: 15px 0 0;
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
}

.membres-avatar img {
    border-radius: 50%;
    border: 3px solid #eee;
}

/* Grille de cartes */
.membres-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.membres-dashboard-card {
    display: block;
    background: #fff;
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid #eee;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.membres-dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.membres-card-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 12px;
}

.membres-dashboard-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.membres-dashboard-card p {
    margin: 0;
    font-size: 13px;
    color: #888;
}

.membres-card-logout:hover {
    border-color: #e74c3c;
}

/* Profil élargi */
.membres-profile-container {
    max-width: 560px;
}

/* =============================================
   Articles réservés aux membres
   ============================================= */

/* Badge "Membres" à côté du titre dans les listes */
.membres-badge {
    display: inline-block;
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

/* Bloc de contenu restreint (remplace l'article) */
.membres-restricted-notice {
    text-align: center;
    padding: 50px 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px dashed #dee2e6;
    margin: 20px 0;
}

.membres-restricted-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.membres-restricted-notice h3 {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px;
}

.membres-restricted-notice p {
    color: #666;
    font-size: 15px;
    max-width: 450px;
    margin: 0 auto 25px;
    line-height: 1.6;
}

.membres-restricted-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.membres-btn-restricted {
    width: auto;
    display: inline-block;
    padding: 12px 28px;
    font-size: 14px;
    text-decoration: none;
    text-align: center;
}

.membres-btn-outline {
    background: transparent;
    color: #0073aa;
    border: 2px solid #0073aa;
}

.membres-btn-outline:hover {
    background: #0073aa;
    color: #fff;
}

/* =============================================
   Toast notification
   ============================================= */

.membres-toast {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 999999;
    animation: membres-toast-slide-in 0.4s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}

.membres-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1a1a1a;
    color: #fff;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    font-size: 14px;
    max-width: 380px;
}

.membres-toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.membres-toast-text {
    flex: 1;
    line-height: 1.4;
}

.membres-toast-close {
    background: none;
    border: none;
    color: #999;
    font-size: 22px;
    cursor: pointer;
    padding: 0 0 0 8px;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
}

.membres-toast-close:hover {
    color: #fff;
}

/* Animation d'entrée */
@keyframes membres-toast-slide-in {
    0% {
        opacity: 0;
        transform: translateX(80px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Animation de sortie */
.membres-toast.membres-toast--closing {
    animation: membres-toast-slide-out 0.3s ease-in forwards;
}

@keyframes membres-toast-slide-out {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(80px) scale(0.95);
    }
}

/* =============================================
   Widget Connexion (sidebar)
   ============================================= */

/* État déconnecté : formulaire compact */
.membres-widget--logged-out .membres-widget-field {
    margin-bottom: 10px;
}

.membres-widget--logged-out .membres-widget-field input[type="text"],
.membres-widget--logged-out .membres-widget-field input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.membres-widget--logged-out .membres-widget-field input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    background: #fff;
}

.membres-widget-remember {
    margin-bottom: 12px !important;
}

.membres-widget-remember label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
}

.membres-widget-remember input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #0073aa;
}

.membres-widget-btn {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border-radius: 6px;
}

/* Liens sous le formulaire widget */
.membres-widget-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.membres-widget-footer a {
    color: #0073aa;
    text-decoration: none;
    font-size: 12px;
}

.membres-widget-footer a:hover {
    text-decoration: underline;
}

/* Message dans le widget */
.membres-widget .membres-message {
    font-size: 12px;
    padding: 8px 10px;
    margin-bottom: 12px;
    border-radius: 6px;
}

/* État connecté : infos membre */
.membres-widget--logged-in {
    text-align: center;
}

.membres-widget-role {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0073aa;
    background: rgba(0, 115, 170, 0.08);
    padding: 2px 10px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 4px;
}

.membres-widget-last-login {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 6px;
    font-style: italic;
}

.membres-widget-restricted-count {
    display: block;
    font-size: 12px;
    color: #0073aa;
    margin-top: 8px;
    text-decoration: none;
    background: #f0f6fc;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.membres-widget-restricted-count:hover {
    background: #e1edf8;
    text-decoration: none;
}

.membres-widget-avatar {
    margin-bottom: 10px;
}

.membres-widget-avatar img {
    border-radius: 50%;
    border: 2px solid #eee;
}

.membres-widget-greeting {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 12px;
}

.membres-widget-links {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left;
    border-top: 1px solid #eee;
}

.membres-widget-links li {
    border-bottom: 1px solid #eee;
}

.membres-widget-links li a {
    display: block;
    padding: 8px 0;
    color: #0073aa;
    text-decoration: none;
    font-size: 13px;
    transition: padding-left 0.2s;
}

.membres-widget-links li a:hover {
    padding-left: 6px;
}

.membres-widget-links li a.membres-widget-logout {
    color: #e74c3c;
}

/* Compteur de membres en ligne */
.membres-widget-online {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    margin-top: 10px;
}

.membres-widget-online-dot {
    width: 8px;
    height: 8px;
    background: #27ae60;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    animation: membres-pulse 2s ease-in-out infinite;
}

@keyframes membres-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Badge nouveaux articles membres */
.membres-widget-new-content {
    display: block;
    font-size: 12px;
    color: #e67e22;
    margin-top: 8px;
    text-decoration: none;
    background: #fef5e7;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.membres-widget-new-content:hover {
    background: #fdebd0;
    text-decoration: none;
}

.membres-widget-new-badge {
    display: inline-block;
    background: #e67e22;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 5px;
    margin-right: 4px;
}

/* =============================================
   Zone de danger — Suppression de compte
   ============================================= */

.membres-danger-zone {
    margin-top: 32px;
    border: 1px solid #f5c6c6;
    border-radius: 10px;
    padding: 24px;
    background: #fff8f8;
}

.membres-danger-zone h3 {
    font-size: 16px;
    font-weight: 700;
    color: #c0392b;
    margin: 0 0 10px;
}

.membres-danger-warning {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 20px;
}

.membres-btn--danger {
    background: #e74c3c;
    border: 1px solid #e74c3c;
    color: #fff;
}

.membres-btn--danger:hover {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

.membres-btn--danger:disabled {
    background: #e8a09a;
    border-color: #e8a09a;
    cursor: not-allowed;
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 768px) {
    .membres-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .membres-form-container {
        margin: 20px 15px;
        padding: 25px 20px;
    }

    .membres-field-row {
        flex-direction: column;
        gap: 0;
    }

    .membres-toast {
        top: auto;
        bottom: 20px;
        right: 15px;
        left: 15px;
    }

    .membres-toast-content {
        max-width: 100%;
    }

    .membres-restricted-actions {
        flex-direction: column;
        align-items: center;
    }

    .membres-btn-restricted {
        width: 100%;
        max-width: 280px;
    }
}
