/* ============================================
   AUTH — Navbar Button
   ============================================ */
.nav-auth-btn {
    display: flex; align-items: center; gap: 8px;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    padding: 7px 18px 7px 14px;
    font-size: 13px; font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s var(--ease);
    font-family: inherit;
    margin-left: 8px;
    white-space: nowrap;
}
.nav-auth-btn i { font-size: 20px; }
.nav-auth-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.nav-auth-btn.logged-in {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.nav-auth-btn.logged-in:hover {
    background: var(--primary);
    color: #fff;
}

/* ============================================
   AUTH — Terms of Service Checkbox
   ============================================ */
.auth-tos-check {
    margin: 16px 0 8px;
}
.tos-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    position: relative;
    padding-left: 32px;
    min-height: 24px;
}
.tos-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.tos-checkmark {
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 5px;
    background: var(--bg-soft);
    transition: all 0.2s;
    flex-shrink: 0;
}
.tos-label input:checked ~ .tos-checkmark {
    background: var(--primary);
    border-color: var(--primary);
}
.tos-checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.tos-label input:checked ~ .tos-checkmark::after {
    display: block;
}
.tos-text {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-muted);
}
.tos-text a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.tos-text a:hover {
    text-decoration: underline;
}

/* ============================================
   AUTH — Modal Overlay
   ============================================ */
.auth-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
}
.auth-overlay.open {
    opacity: 1; visibility: visible;
}
.auth-modal {
    background: var(--bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    width: 440px; max-width: 95vw;
    padding: 36px 32px 32px;
    position: relative;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.35s var(--ease);
}
.auth-overlay.open .auth-modal {
    transform: translateY(0) scale(1);
}

/* Close */
.auth-close {
    position: absolute; top: 16px; right: 16px;
    background: none; border: none;
    font-size: 22px; color: var(--text-muted);
    cursor: pointer; padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.auth-close:hover { color: var(--text-dark); background: var(--bg-soft); }

/* ============================================
   AUTH — Tabs
   ============================================ */
.auth-tabs {
    display: flex; gap: 4px;
    background: var(--bg-soft);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 28px;
}
.auth-tab {
    flex: 1;
    padding: 10px 16px;
    border: none; background: none;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
}
.auth-tab.active {
    background: var(--bg);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.auth-tab:hover:not(.active) { color: var(--text-dark); }

/* ============================================
   AUTH — Form
   ============================================ */
.auth-form { display: block; }
.auth-field { margin-bottom: 18px; }
.auth-field label {
    display: block;
    font-size: 13px; font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}
.auth-field label small {
    font-weight: 400; color: var(--text-muted);
}
.auth-input-wrap {
    display: flex; align-items: center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg);
}
.auth-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.auth-input-wrap i {
    font-size: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-right: 10px;
}
.auth-input-wrap input {
    flex: 1;
    border: none; outline: none; background: none;
    padding: 12px 0;
    font-size: 14px;
    color: var(--text-dark);
    font-family: inherit;
}
.auth-input-wrap input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.auth-error {
    font-size: 13px;
    color: #ef4444;
    margin-bottom: 12px;
    min-height: 18px;
    display: flex; align-items: center; gap: 6px;
}
.auth-error:empty { display: none; }
.auth-error::before {
    content: '⚠';
    font-size: 14px;
}

.auth-submit {
    margin-top: 6px;
    padding: 13px 24px;
    font-size: 15px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-submit:disabled {
    opacity: 0.6; cursor: not-allowed;
}

/* ── Divider ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

/* ── Google Button ── */
.btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-main);
    color: #374151;
    background: #fff;
    border: 1.5px solid #dadce0;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s var(--ease);
}
.btn-google:hover {
    background: #f8f9fa;
    border-color: #c6c9cc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.btn-google:active {
    transform: scale(0.98);
}
.btn-google svg {
    flex-shrink: 0;
}

/* ============================================
   USER DROPDOWN
   ============================================ */
.user-dropdown {
    position: fixed;
    top: 70px; right: 24px;
    width: 320px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s var(--ease);
}
.user-dropdown.open {
    opacity: 1; visibility: visible; transform: translateY(0);
}

.user-dd-header {
    display: flex; align-items: center; gap: 12px;
}
.user-dd-avatar {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    color: var(--primary);
    font-size: 28px;
}
.user-dd-info { flex: 1; overflow: hidden; }
.user-dd-info strong {
    display: block;
    font-size: 15px; font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-dd-info small {
    font-size: 12px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: block;
}

.user-dd-divider {
    height: 1px;
    background: var(--border-light);
    margin: 14px 0;
}

.user-dd-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.user-dd-pkg-list {
    display: flex; flex-direction: column; gap: 6px;
}
.user-dd-pkg {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.user-dd-pkg-name { font-weight: 600; color: var(--text-dark); }
.user-dd-pkg-status {
    font-size: 11px; font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}
.user-dd-pkg-status.pending {
    background: #fef3c7; color: #92400e;
}
.user-dd-pkg-status.active {
    background: #d1fae5; color: #065f46;
}
.user-dd-empty {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    padding: 4px 0;
}

.user-dd-logout {
    display: flex; align-items: center; gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: none;
    font-size: 13px; font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.user-dd-logout:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

/* ============================================
   PURCHASE TOAST
   ============================================ */
.purchase-toast {
    position: fixed;
    bottom: 24px; right: 24px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 16px 20px;
    display: flex; align-items: center; gap: 12px;
    z-index: 10001;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s var(--ease);
    max-width: 360px;
}
.purchase-toast.show {
    transform: translateY(0); opacity: 1;
}
.purchase-toast-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    color: var(--primary);
    font-size: 20px;
    flex-shrink: 0;
}
.purchase-toast-text {
    font-size: 14px; color: var(--text-dark); font-weight: 500;
    line-height: 1.5;
}
.purchase-toast-text strong { color: var(--primary); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .nav-auth-btn span { display: none; }
    .nav-auth-btn { padding: 7px 10px; margin-left: 4px; }
    
    .auth-modal { padding: 28px 20px 24px; }
    .auth-tabs { margin-bottom: 20px; }

    .user-dropdown { right: 12px; left: 12px; width: auto; }
}
@media (max-width: 480px) {
    .nav-auth-btn { padding: 6px 8px; }
    .nav-auth-btn i { font-size: 18px; }
    .auth-modal { padding: 24px 16px 20px; }
}
