/* ==========================================================================
   ACCOUNTS & IDENTITY MODAL • components/account-frontend-modal.css
   Cadastro, Login, Recuperação de Senha, Perfil, Reputação e Social Graph
   ========================================================================== */

:root {
    --acc-bg: #090a0c;
    --acc-surface: #111317;
    --acc-surface-hover: #16191f;
    --acc-surface-subtle: #181b21;
    --acc-border: rgba(255, 255, 255, 0.08);
    --acc-border-focus: rgba(255, 255, 255, 0.22);
    --acc-text-high: #fcfcfd;
    --acc-text-med: #9ba1ad;
    --acc-text-muted: #5e6472;
    --acc-brand: #7b61ff;
    --acc-brand-glow: rgba(123, 97, 255, 0.25);
    --acc-brand-hover: #8f77ff;
    --acc-success: #10b981;
    --acc-danger: #ff4757;
    --acc-warning: #f59e0b;
}

/* Backdrop & Caixa do Modal */
.accounts-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
    overflow-y: auto;
}

.auth-container-modal {
    width: 100%;
    max-width: 470px;
    background: var(--acc-surface);
    border: 1px solid var(--acc-border);
    border-radius: 26px;
    padding: 32px 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.95);
    position: relative;
    margin: auto;
}

.btn-modal-close-corner {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--acc-text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: color 0.18s;
    line-height: 1;
}
.btn-modal-close-corner:hover { color: #fff; }

/* Status da API & Banner do Visitante */
.top-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-right: 28px;
}
.service-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--acc-text-muted);
    background: var(--acc-surface-subtle);
    padding: 4px 10px;
    border-radius: 9999px;
    border: 1px solid var(--acc-border);
}
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--acc-success);
    box-shadow: 0 0 8px var(--acc-success);
}
.status-dot.degraded {
    background: var(--acc-warning);
    box-shadow: 0 0 8px var(--acc-warning);
}

.visitor-banner {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(123, 97, 255, 0.08);
    border: 1px dashed rgba(123, 97, 255, 0.28);
    border-radius: 14px;
    margin-bottom: 20px;
}
.visitor-banner img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--acc-brand);
}
.visitor-banner-info { font-size: 12px; color: var(--acc-text-med); line-height: 1.35; }
.visitor-banner-info strong { color: var(--acc-text-high); }

/* Cabeçalho do Card */
.auth-header { text-align: center; margin-bottom: 22px; }
.brand-symbol {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #7b61ff 0%, #4f29f0 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px var(--acc-brand-glow);
}
.brand-symbol svg { width: 22px; height: 22px; fill: #fff; }
.auth-title { font-size: 20px; font-weight: 800; color: var(--acc-text-high); }
.auth-desc { font-size: 12.5px; color: var(--acc-text-muted); margin-top: 5px; }

/* Formulários: Login, Cadastro & Recuperação */
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; position: relative; }
.form-label-row { display: flex; justify-content: space-between; align-items: center; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--acc-text-med); }

.form-control {
    background: var(--acc-bg);
    border: 1px solid var(--acc-border);
    border-radius: 12px;
    padding: 11px 15px;
    color: #fff;
    font-size: 13.5px;
    outline: none;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
}
.form-control:focus {
    border-color: var(--acc-border-focus);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-prefix {
    position: absolute;
    left: 14px;
    color: var(--acc-brand);
    font-weight: 700;
    font-size: 15px;
    pointer-events: none;
    z-index: 1;
}
.auth-input-prefixed { padding-left: 32px !important; }

.input-suffix-status {
    position: absolute;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.status-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--acc-brand);
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
}

.form-feedback {
    font-size: 11px;
    margin-top: 4px;
    min-height: 14px;
    transition: color 0.18s;
}
.form-feedback.valid { color: var(--acc-success); }
.form-feedback.invalid { color: var(--acc-danger); }
.form-feedback.warning { color: var(--acc-warning); }
.catalog-tooltip-hint { font-size: 11px; color: var(--acc-text-muted); line-height: 1.3; }

.btn-brand-acc {
    background: var(--acc-brand);
    color: #fff;
    border: none;
    padding: 12px 18px;
    border-radius: 9999px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 6px;
    transition: all 0.18s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    width: 100%;
}
.btn-brand-acc:hover:not(:disabled) {
    background: var(--acc-brand-hover);
    box-shadow: 0 4px 20px var(--acc-brand-glow);
}
.btn-brand-acc:disabled { opacity: 0.45; cursor: not-allowed; }

.auth-nav-links {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-top: 16px;
    color: var(--acc-text-muted);
}
.auth-nav-links a { color: var(--acc-brand); text-decoration: none; font-weight: 600; }

/* Upload de Avatar */
.avatar-edit-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}
.avatar-clickable-box {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    border: 2px solid var(--acc-brand);
    box-shadow: 0 0 20px var(--acc-brand-glow);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--acc-surface-subtle);
}
.avatar-clickable-box img { width: 100%; height: 100%; object-fit: cover; }
.avatar-overlay-hint {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
    color: #fff; font-size: 11px; font-weight: 600; gap: 4px;
}
.avatar-clickable-box:hover .avatar-overlay-hint { opacity: 1; }
.avatar-helper-text { font-size: 11.5px; color: var(--acc-text-muted); cursor: pointer; }
.avatar-helper-text strong { color: var(--acc-brand); }

/* Switch de Privacidade */
.privacy-box {
    background: var(--acc-surface-subtle);
    border: 1px solid var(--acc-border);
    padding: 12px 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}
.privacy-text h5 { font-size: 13px; font-weight: 600; color: var(--acc-text-high); }
.privacy-text p { font-size: 11px; color: var(--acc-text-muted); margin-top: 2px; }

.switch { position: relative; display: inline-block; width: 42px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background-color: #272a30; transition: .3s; border-radius: 22px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: var(--acc-brand); }
input:checked + .slider:before { transform: translateX(20px); }

/* Painel de Reputação (3 Pilares) */
.reputation-container {
    margin: 6px 0 2px 0;
    padding: 12px;
    background: var(--acc-surface-subtle);
    border: 1px solid var(--acc-border);
    border-radius: 12px;
}
.reputation-header {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--acc-text-med);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.reputation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.reputation-card {
    background: var(--acc-surface);
    border: 1px solid var(--acc-border);
    border-radius: 8px;
    padding: 8px 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.rep-icon { font-size: 14px; }
.rep-name { font-size: 10px; color: var(--acc-text-muted); font-weight: 600; }
.rep-val { font-size: 11.5px; font-weight: 700; color: var(--acc-text-high); }
.rep-indicator-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    margin-top: 3px;
    overflow: hidden;
}
.rep-indicator-fill { height: 100%; background: var(--acc-brand); border-radius: 9999px; }

.profile-action-links { display: flex; justify-content: center; margin-top: 4px; }
.btn-link-action {
    background: none;
    border: none;
    color: var(--acc-brand);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.btn-logout-acc {
    background: none;
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: var(--acc-danger);
    padding: 10px;
    border-radius: 9999px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    transition: all 0.2s;
    width: 100%;
}
.btn-logout-acc:hover { background: rgba(255, 71, 87, 0.1); }

/* Modal Social Preview & Sistema de Follow */
.social-preview-modal-card {
    background: var(--acc-surface);
    border: 1px solid var(--acc-border-focus);
    border-radius: 24px;
    width: 100%;
    max-width: 380px;
    padding: 26px 20px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.95);
    position: relative;
}
.social-preview-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 2px solid var(--acc-brand);
    margin: 0 auto 10px;
    object-fit: cover;
    box-shadow: 0 0 16px var(--acc-brand-glow);
}
.social-preview-counts {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 11.5px;
    color: var(--acc-text-med);
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--acc-border);
}
.social-preview-counts strong { color: var(--acc-text-high); font-weight: 700; }

.btn-follow-toggle {
    margin-top: 14px;
    background: var(--acc-brand);
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 9999px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-follow-toggle:hover:not(:disabled) {
    background: var(--acc-brand-hover);
    box-shadow: 0 4px 16px var(--acc-brand-glow);
}
.btn-follow-toggle.following {
    background: transparent;
    border: 1px solid var(--acc-border-focus);
    color: var(--acc-text-high);
}
.btn-follow-toggle.following:hover {
    border-color: var(--acc-danger);
    color: var(--acc-danger);
    background: rgba(255, 71, 87, 0.08);
}

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 99999;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    min-width: 250px;
    max-width: 340px;
    background: #15181e;
    border: 1px solid var(--acc-border);
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 12.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--acc-success); }
.toast.error { border-color: var(--acc-danger); }
.toast.warning { border-color: var(--acc-warning); }

@keyframes spin { 100% { transform: rotate(360deg); } }

/* Utilitários Visuais de Identidade e Visitantes */
.author-nick-tag {
    color: var(--acc-brand);
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.author-nick-tag:hover { text-decoration: underline; }

.visitor-cd-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 107, 53, 0.12);
    color: #ff6b35;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    animation: visitor-pulse 1s ease-in-out infinite;
}
.visitor-cd-icon { font-size: 13px; }
.visitor-cd-secs { font-variant-numeric: tabular-nums; }
@keyframes visitor-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.visitor-signup-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    background: linear-gradient(135deg, #7b61ff, #5b4dff);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s;
}
.visitor-signup-hint:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 12px rgba(123, 97, 255, 0.4);
}

.visitor-avatar-picker { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    z-index: 10001; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.visitor-avatar-picker-overlay { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.5); 
}
.visitor-avatar-picker-panel { 
    position: relative; 
    background: #1a1a2e; 
    border-radius: 16px; 
    padding: 20px; 
    width: 280px; 
    box-shadow: 0 8px 32px rgba(0,0,0,0.4); 
    border: 1px solid rgba(123,97,255,0.3); 
}
.visitor-avatar-picker-title { 
    text-align: center; 
    color: #dfe6e9; 
    font-size: 14px; 
    font-weight: 600; 
    margin-bottom: 14px; 
}
.visitor-avatar-picker-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px; 
}
.visitor-avatar-option { 
    width: 72px; 
    height: 72px; 
    border-radius: 50%; 
    cursor: pointer; 
    border: 3px solid transparent; 
    transition: transform 0.15s, border-color 0.15s; 
    overflow: hidden; 
}
.visitor-avatar-option:hover { transform: scale(1.1); }
.visitor-avatar-option.selected { 
    border-color: #7b61ff; 
    transform: scale(1.05); 
    box-shadow: 0 0 12px rgba(123,97,255,0.5); 
}
.visitor-avatar-option img { width: 100%; height: 100%; object-fit: cover; }
.visitor-avatar-picker-done { 
    width: 100%; 
    margin-top: 14px; 
    padding: 8px; 
    border: none; 
    border-radius: 8px; 
    background: #7b61ff; 
    color: #fff; 
    font-weight: 600; 
    cursor: pointer; 
}