/* ============================================
   FBPROTOOLS - Auth Styles
   ============================================ */

/* Sidebar User Area */
.sidebar-user-area {
    padding: 0.75rem 1rem;
    margin: 0 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    user-select: none;
}

.user-avatar-btn:hover {
    background: var(--bg-sidebar-hover);
}

.user-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9375rem;
    flex-shrink: 0;
}

.user-avatar-empty {
    background: var(--bg-sidebar-hover);
    color: var(--text-secondary);
}

.user-name-text {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    transition: var(--transition);
}

.user-chevron {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

/* Dropdown */
.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0.5rem;
    right: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
    margin-top: 0.25rem;
}

.user-dropdown.show {
    display: block;
    animation: fadeInDown 0.15s ease;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
    box-shadow: none;
    border-radius: 0;
}

.user-dropdown-item::before {
    display: none;
}

.user-dropdown-item:hover {
    background: var(--bg-sidebar-hover);
    transform: none;
    box-shadow: none;
}

.user-dropdown-logout {
    color: #ef4444;
    border-top: 1px solid var(--border-color);
}

.user-dropdown-logout:hover {
    background: #fef2f2;
}

/* Collapsed sidebar */
.sidebar.collapsed .sidebar-user-area {
    padding: 0.75rem 0.25rem;
    margin: 0 0.25rem 0.75rem;
}

.sidebar.collapsed .user-name-text,
.sidebar.collapsed .user-chevron {
    display: none;
}

.sidebar.collapsed .user-avatar-btn {
    justify-content: center;
    padding: 0.5rem;
}

/* ============================================
   AUTH MODAL
   ============================================ */

.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-modal {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 0;
}

.auth-modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.auth-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-main);
    border-radius: 50%;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: none;
    line-height: 1;
}

.auth-modal-close::before {
    display: none;
}

.auth-modal-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
    transform: none;
    box-shadow: none;
}

.auth-modal-body {
    padding: 1.5rem;
}

.auth-field {
    margin-bottom: 1rem;
}

.auth-field label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.auth-field input,
.auth-field select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: var(--transition);
}

.auth-field input:focus,
.auth-field select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-field-row {
    display: flex;
    gap: 0.75rem;
}

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

@media (max-width: 480px) {
    .auth-field-row {
        flex-direction: column;
        gap: 0;
    }
}

.auth-error {
    display: none;
    color: #ef4444;
    background: #fef2f2;
    padding: 0.625rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    border: 1px solid #fecaca;
}

.auth-success {
    display: none;
    color: #059669;
    background: #d1fae5;
    padding: 0.625rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    border: 1px solid #a7f3d0;
}

.auth-submit-btn {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}
