/* ═══════════════════════════════════════════════
   AUTH STYLES
   ═══════════════════════════════════════════════ */

/* ─── Header Right Area ─── */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ─── Auth Header Button ─── */
.auth-header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

.auth-header-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);
}

/* ─── User Menu ─── */
.user-menu {
    position: relative;
    align-items: center;
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 5px 12px 5px 5px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.user-avatar-btn:hover {
    border-color: var(--primary);
    background: var(--bg);
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

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

.dropdown-arrow {
    font-size: 0.75rem;
    color: var(--text-sub);
}

/* ─── User Dropdown ─── */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px;
    min-width: 220px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 200;
}

.user-dropdown.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.dropdown-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
}

.dropdown-email {
    font-size: 0.75rem;
    color: var(--text-sub);
    margin-top: 2px;
}

.dropdown-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.875rem;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--bg);
    color: var(--primary);
}

/* ─── Plan Badge (헤더 버튼 내) ─── */
.plan-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    letter-spacing: 0.02em;
}

/* ─── Dropdown Plan Label ─── */
.dropdown-plan {
    font-size: 0.72rem;
    font-weight: 700;
    margin-top: 3px;
    color: #f59e0b;
}

/* ─── Upgrade Button ─── */
.upgrade-item {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(249, 115, 22, 0.12));
    color: #f59e0b !important;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.upgrade-item:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(249, 115, 22, 0.2)) !important;
    color: #f59e0b !important;
}

/* Pro 플랜이면 업그레이드 버튼 숨기기 */
.plan-pro #upgradeBtn,
.plan-premium #upgradeBtn {
    display: none;
}

/* ─── Auth Modal Overlay ─── */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.auth-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ─── Auth Modal Card ─── */
.auth-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 36px 32px 32px;
    width: 100%;
    max-width: 420px;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.25s ease;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

.auth-modal-overlay.active .auth-modal {
    transform: scale(1) translateY(0);
}

.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.auth-modal-close:hover {
    background: var(--border);
    color: var(--text);
}

/* ─── Auth Tabs ─── */
.auth-tabs {
    display: flex;
    background: var(--bg);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 9px;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.auth-tab-btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ─── Modal Title ─── */
.auth-modal-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.auth-modal-sub {
    font-size: 0.875rem;
    color: var(--text-sub);
    margin-bottom: 20px;
}

/* ─── Google Button ─── */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.google-btn:hover {
    border-color: #4285f4;
    background: rgba(66, 133, 244, 0.06);
    transform: translateY(-1px);
}

/* ─── Divider ─── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-sub);
    font-size: 0.8rem;
}

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

/* ─── Form Fields ─── */
.auth-field {
    margin-bottom: 14px;
}

.auth-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-input {
    width: 100%;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 0.9rem;
    color: var(--text);
    font-family: inherit;
    transition: var(--transition);
    box-sizing: border-box;
}

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

/* ─── Error ─── */
.auth-error {
    font-size: 0.8rem;
    color: #ef4444;
    margin: -6px 0 10px;
    min-height: 18px;
}

/* ─── Submit Button ─── */
.auth-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 13px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    margin-top: 4px;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.auth-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ─── Switch Link ─── */
.auth-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-sub);
}

.auth-switch button {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    margin-left: 4px;
    text-decoration: underline;
}

/* ─── Toast ─── */
.auth-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1e293b;
    color: #fff;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    white-space: nowrap;
}

.auth-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
    .auth-modal {
        margin: 16px;
        padding: 28px 20px 24px;
        border-radius: 20px;
    }

    .user-name {
        display: none;
    }

    .header-right {
        gap: 8px;
    }
}