/* Shared auth styles for Prompt Comtag */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(14px);
}

.workbench-page .auth-modal-overlay {
    background: rgba(0, 0, 0, 0.46);
    backdrop-filter: none;
}

.auth-modal-overlay.hidden {
    display: none;
}

.auth-modal-shell {
    position: relative;
    width: min(458px, 100%);
    border-radius: 18px;
    border: 1px solid rgba(108, 92, 231, 0.24);
    background: linear-gradient(180deg, rgba(20, 20, 24, 0.98), rgba(12, 12, 14, 0.98));
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
    padding: 28px;
}

.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: #9CA3AF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.auth-brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.auth-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.auth-brand-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.auth-brand-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 4px 0 6px;
}

.auth-desc {
    font-size: 13px;
    line-height: 1.5;
    color: #9CA3AF;
    margin-bottom: 18px;
}

.auth-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 6px;
    border-radius: 12px;
    background: #1A1A1A;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 16px;
}

.auth-switch button {
    border: 0;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    background: transparent;
    color: #9CA3AF;
}

.auth-switch button.active {
    background: #2A2A2A;
    color: #fff;
}

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

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

.auth-field label {
    font-size: 12px;
    color: #B7B7C2;
}

.auth-field input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid #2A2A2A;
    background: #111114;
    color: #fff;
    padding: 12px 14px;
    outline: none;
    font-size: 14px;
}

.auth-field input:focus {
    border-color: rgba(108, 92, 231, 0.8);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.14);
}

.auth-avatar-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 0;
}

.auth-avatar-label {
    font-size: 13px;
    font-weight: 700;
    color: #E5E7EB;
    margin-top: 0;
}

.auth-avatar-picker {
    display: grid;
    grid-template-columns: repeat(4, 72px);
    justify-content: center;
    gap: 10px;
}

.auth-avatar-option {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, #19202d 0%, #151b25 100%);
    border-radius: 999px;
    width: 72px;
    height: 72px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    cursor: pointer;
    color: #C7C7D4;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: visible;
}

.auth-avatar-option:hover {
    transform: translateY(-1px);
    border-color: rgba(135, 108, 255, 0.55);
}

.auth-avatar-option.active {
    border-color: rgba(135, 108, 255, 1);
    box-shadow: inset 0 0 0 2px rgba(135, 108, 255, 0.8), 0 0 0 2px rgba(135, 108, 255, 0.22);
}

.auth-avatar-option span {
    display: none;
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
    color: #E5E7EB;
}

.auth-avatar-image {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    background: #121826;
}

.auth-avatar-art {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background-repeat: no-repeat;
    background-size: 200% 200%;
    background-color: #121826;
}

.auth-avatar-option .auth-avatar-art,
.auth-avatar-option .auth-avatar-image {
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.auth-avatar-option::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    pointer-events: none;
}

.auth-avatar-option .auth-avatar-check {
    position: absolute;
    right: 2px;
    bottom: 0;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #8B5CF6;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(139, 92, 246, 0.35);
}

.auth-avatar-option.active .auth-avatar-check {
    display: flex;
}

.auth-avatar-option .auth-avatar-check iconify-icon {
    font-size: 12px;
}

.auth-submit {
    margin-top: 4px;
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #6C5CE7, #8B7CF7);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.auth-submit:hover {
    filter: brightness(1.02);
}

.auth-inline {
    font-size: 12px;
    color: #9CA3AF;
    line-height: 1.5;
}

.auth-inline strong {
    color: #EDE9FE;
    font-weight: 600;
}

.auth-error {
    min-height: 18px;
    font-size: 12px;
    color: #F87171;
}

.auth-user-shell {
    position: relative;
}

.auth-user-button {
    min-width: 88px;
    height: 40px;
    padding: 0 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(135deg, #6C5CE7, #8B7CF7);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.auth-user-button:hover {
    filter: brightness(1.05);
}

.auth-avatar-chip {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 999px;
    overflow: hidden;
    justify-content: center;
}

.auth-avatar-chip .auth-avatar-image,
.auth-avatar-chip .auth-avatar-art,
.auth-user-button .auth-avatar-image,
.auth-user-button .auth-avatar-art {
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

.auth-user-menu {
    position: absolute;
    right: 0;
    top: 40px;
    min-width: 252px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #121214;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
}

.auth-user-menu.hidden {
    display: none;
}

header .btn-primary.auth-go-main-disabled,
header .btn-outline.auth-go-main-disabled,
header [data-auth-go-main].auth-go-main-disabled,
[data-auth-go-main].auth-go-main-disabled {
    background: rgba(31, 31, 35, 0.92) !important;
    color: #6B7280 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

header .btn-primary.auth-go-main-ready {
    background: linear-gradient(135deg, #6C5CE7, #8B7CF7);
    color: #FFFFFF;
}

.auth-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.auth-user-email {
    padding: 2px 2px 0;
    overflow: hidden;
    color: #D1D5DB;
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-menu-divider {
    height: 1px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.08);
}

.auth-subscription-panel {
    display: grid;
    gap: 10px;
}

.auth-subscription-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #8F95A3;
    font-size: 12px;
    line-height: 18px;
}

.auth-plan-badge {
    flex: 0 0 auto;
    padding: 2px 8px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #C4C8D2;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
}

.auth-plan-badge--active {
    border-color: rgba(139, 124, 247, 0.34);
    background: rgba(108, 92, 231, 0.16);
    color: #B9AEFF;
}

.auth-plan-badge--expired {
    border-color: rgba(248, 113, 113, 0.26);
    background: rgba(248, 113, 113, 0.1);
    color: #FCA5A5;
}

.auth-subscription-date,
.auth-subscription-expired {
    color: #8F95A3;
    font-size: 12px;
    line-height: 18px;
}

.auth-subscription-expired {
    margin-top: -4px;
    color: #FCA5A5;
}

.auth-subscription-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.auth-subscription-action {
    min-height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: #D7DAE2;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.auth-subscription-action:hover {
    border-color: rgba(139, 124, 247, 0.46);
    background: rgba(108, 92, 231, 0.15);
    color: #FFFFFF;
}

.auth-subscription-action--primary {
    width: 100%;
    border-color: transparent;
    background: linear-gradient(135deg, #6C5CE7, #8170F1);
    color: #FFFFFF;
}

.auth-subscription-action--primary:hover {
    border-color: transparent;
    background: linear-gradient(135deg, #7868F0, #8B7CF7);
}

.auth-user-logout {
    width: 100%;
    margin-top: 0;
    border: 0;
    border-radius: 10px;
    padding: 12px 10px;
    background: rgba(248, 113, 113, 0.12);
    color: #F87171;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

.auth-user-logout:hover {
    background: rgba(248, 113, 113, 0.18);
}
