/* Authentication Modal & Forms */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

.auth-modal-content {
    position: relative;
    width: 100%;
    max-width: 450px;
    background: linear-gradient(180deg, #243447, #1a2332);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 24px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.24);
}

.auth-modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #f0f4fc 0%, #6aa7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-modal-subtitle {
    color: var(--muted);
    margin-bottom: 28px;
    font-size: 0.95rem;
}

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

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.auth-input {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(10, 16, 28, 0.5);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.auth-input:focus {
    border-color: rgba(106, 167, 255, 0.6);
    box-shadow: 0 0 0 4px rgba(106, 167, 255, 0.12);
    background: rgba(10, 16, 28, 0.7);
}

.auth-input::placeholder {
    color: rgba(240, 244, 252, 0.4);
}

.auth-error {
    color: var(--danger);
    font-size: 0.85rem;
    min-height: 20px;
}

.auth-submit {
    margin-top: 8px;
    padding: 14px 24px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #2153cc, #6aa7ff);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(106, 167, 255, 0.4);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 20px;
    color: var(--muted);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-oauth {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-oauth-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
}

.auth-oauth-btn svg {
    width: 20px;
    height: 20px;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.auth-link {
    color: var(--primary2);
    cursor: pointer;
    text-decoration: underline;
}

.auth-link:hover {
    color: var(--primary);
}

/* User Menu */
.auth-user-menu {
    position: relative;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.auth-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2153cc, #6aa7ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.auth-user-name {
    font-weight: 600;
    color: var(--text);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-user-dropdown {
    position: absolute;
    top: 100%;
    /* flush with bottom of button */
    right: 0;
    min-width: 180px;
    background: #243447;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    display: none;
    margin-top: 0;
    /* ensure no margin gap */
}

.auth-user-menu:hover .auth-user-dropdown {
    display: block;
}

.auth-dropdown-item {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s ease;
}

.auth-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}