/* ============================================================
   Account Page — URBot.net Dark Theme
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #0d0d1a;
    --surface:   #12121f;
    --surface2:  #1a1a2e;
    --border:    #2a2a42;
    --text:      #e2e8f0;
    --muted:     #8892a4;
    --accent:    #7c3aed;
    --accent2:   #6366f1;
    --green:     #22c55e;
    --yellow:    #f59e0b;
    --red:       #ef4444;
    --radius:    10px;
    --shadow:    0 4px 24px rgba(0,0,0,0.45);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; color: #a78bfa; }

button {
    cursor: pointer;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: opacity 0.15s, transform 0.1s;
}
button:hover:not(:disabled) { opacity: 0.88; }
button:active:not(:disabled) { transform: scale(0.97); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---- Header ---- */
.acct-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.acct-logo {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text);
    letter-spacing: 1px;
    text-decoration: none;
}
.acct-logo:hover { text-decoration: none; color: #fff; }
.acct-header-nav {
    display: flex;
    gap: 1.25rem;
    margin-left: auto;
    font-size: 0.875rem;
}
.acct-header-nav a { color: var(--muted); }
.acct-header-nav a:hover { color: var(--text); text-decoration: none; }

/* ---- Page wrapper ---- */
.acct-page {
    max-width: 880px;
    margin: 0 auto;
    padding: 2rem 1rem 5rem;
}

/* ---- Auth wall ---- */
.acct-auth-wall {
    text-align: center;
    padding: 5rem 1rem;
}
.acct-auth-wall-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.acct-auth-wall h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.acct-auth-wall p { color: var(--muted); margin-bottom: 1.75rem; }

/* ---- Loading skeleton ---- */
.skel {
    background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
    background-size: 200% 100%;
    animation: skel-anim 1.4s infinite;
    border-radius: 6px;
    display: block;
}
@keyframes skel-anim { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }

/* ---- Profile strip ---- */
.acct-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}
.acct-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}
.acct-profile-info { flex: 1; min-width: 0; }
.acct-display-name { font-weight: 700; font-size: 1rem; }
.acct-email-text { font-size: 0.85rem; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-profile-badges { margin-top: 4px; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.acct-logout-link { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.acct-logout-link:hover { color: var(--red); text-decoration: none; }

/* Plan badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-allaccess  { background: rgba(124,58,237,0.2); color: #c4b5fd; border: 1px solid rgba(124,58,237,0.35); }
.badge-individual { background: rgba(99,102,241,0.18); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.3); }
.badge-cancelling { background: rgba(245,158,11,0.18); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.badge-none       { background: rgba(136,146,164,0.12); color: var(--muted); border: 1px solid rgba(136,146,164,0.2); }

/* ---- Tabs ---- */
.acct-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    gap: 0;
}
.tab-btn {
    background: transparent;
    color: var(--muted);
    padding: 0.65rem 1.3rem;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}
.tab-btn:hover { color: var(--text); opacity: 1; }
.tab-btn.active { color: #a78bfa; border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: tab-fade 0.2s ease; }
@keyframes tab-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- Cards ---- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.card-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
}

/* ---- Subscription tab ---- */
.sub-plan-name {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a78bfa, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
}
.sub-meta { color: var(--muted); font-size: 0.875rem; margin-bottom: 1rem; }
.sub-meta strong { color: var(--text); }

.sub-features { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.25rem; }
.sub-feature {
    background: rgba(124,58,237,0.1);
    border: 1px solid rgba(124,58,237,0.2);
    color: #c4b5fd;
    font-size: 0.78rem;
    padding: 0.18rem 0.55rem;
    border-radius: 20px;
}

.sub-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.25rem; }

/* Cancel warning banner */
.cancel-warning {
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.25);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    color: #fcd34d;
    margin-top: 1rem;
    display: none;
}
.cancel-warning.visible { display: block; }

/* No subscription empty state */
.no-sub { text-align: center; padding: 2.5rem 1rem; }
.no-sub-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.no-sub h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.no-sub p { color: var(--muted); font-size: 0.875rem; margin-bottom: 1.25rem; }

/* Usage progress bar */
.usage-bar-wrap { margin-top: 1rem; }
.usage-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.3rem;
}
.usage-bar-track {
    height: 6px;
    background: var(--surface2);
    border-radius: 3px;
    overflow: hidden;
}
.usage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ---- Buttons ---- */
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    padding: 0.65rem 1.6rem;
    font-weight: 600;
    border-radius: var(--radius);
    display: inline-block;
    text-align: center;
}
.btn-secondary {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.55rem 1.2rem;
    font-weight: 500;
}
.btn-cancel {
    background: rgba(239,68,68,0.1);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.25);
    padding: 0.55rem 1.2rem;
    font-weight: 600;
}
.btn-cancel:hover { background: rgba(239,68,68,0.2); opacity: 1; }
.btn-reactivate {
    background: rgba(34,197,94,0.1);
    color: #86efac;
    border: 1px solid rgba(34,197,94,0.25);
    padding: 0.55rem 1.2rem;
    font-weight: 600;
}
.btn-reactivate:hover { background: rgba(34,197,94,0.2); opacity: 1; }
.btn-danger {
    background: rgba(239,68,68,0.12);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.3);
    padding: 0.55rem 1.2rem;
    font-weight: 600;
}
.btn-danger:hover { background: rgba(239,68,68,0.22); opacity: 1; }

/* ---- My Bots tab ---- */
.bot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.85rem;
}
.bot-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 0.15s;
}
.bot-card:hover { border-color: var(--accent); }
.bot-card-avatar {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    overflow: hidden;
}
.bot-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bot-card-name { font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.bot-card-tier {
    font-size: 0.72rem;
    color: var(--muted);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.12rem 0.5rem;
    align-self: flex-start;
}
.bot-card-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: auto;
}
.bot-btn {
    flex: 1;
    text-align: center;
    padding: 0.35rem 0;
    border-radius: 6px;
    font-size: 0.73rem;
    font-weight: 600;
    text-decoration: none;
}
.bot-btn:hover { text-decoration: none; opacity: 0.85; }
.bot-btn-chat {
    background: rgba(99,102,241,0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99,102,241,0.25);
}
.bot-btn-dl {
    background: rgba(34,197,94,0.12);
    color: #86efac;
    border: 1px solid rgba(34,197,94,0.2);
}

/* All-Access unlock banner */
.all-access-banner {
    background: rgba(124,58,237,0.08);
    border: 1px solid rgba(124,58,237,0.3);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.all-access-banner p { font-size: 0.875rem; color: var(--muted); margin-top: 0.25rem; }
.all-access-banner a { color: #c4b5fd; }

/* ---- Security tab ---- */
.security-section { margin-bottom: 1.25rem; }

.form-group { margin-bottom: 1rem; }
.form-label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.4rem;
    font-weight: 500;
}
.form-input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    padding: 0.6rem 0.85rem;
    transition: border-color 0.15s;
    outline: none;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: rgba(136,146,164,0.5); }

.pw-strength-bar {
    height: 3px;
    border-radius: 2px;
    background: var(--border);
    margin-top: 0.4rem;
    overflow: hidden;
}
.pw-strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
    width: 0;
}
.pw-hint { font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; }

.btn-submit {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    padding: 0.65rem 1.6rem;
    font-weight: 600;
    border-radius: var(--radius);
    margin-top: 0.25rem;
}

/* Sessions list */
.session-list { display: flex; flex-direction: column; gap: 0.5rem; }
.session-item {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}
.session-icon { font-size: 1.2rem; flex-shrink: 0; }
.session-device { font-weight: 600; color: var(--text); }
.session-meta { font-size: 0.78rem; color: var(--muted); }
.session-current {
    font-size: 0.72rem;
    background: rgba(34,197,94,0.12);
    color: #86efac;
    border: 1px solid rgba(34,197,94,0.2);
    border-radius: 20px;
    padding: 0.1rem 0.5rem;
    margin-left: auto;
    white-space: nowrap;
}
.logout-all-wrap { margin-top: 1rem; }
.sessions-loading { color: var(--muted); font-size: 0.875rem; padding: 1rem 0; }

/* Divider */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }

/* ---- Confirm modal ---- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow);
    text-align: center;
}
.modal-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.modal h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.modal p { color: var(--muted); font-size: 0.875rem; margin-bottom: 1.5rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: center; }
.btn-modal-keep {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.6rem 1.4rem;
    font-weight: 600;
}
.btn-modal-confirm {
    background: var(--red);
    color: #fff;
    padding: 0.6rem 1.4rem;
    font-weight: 600;
}

/* ---- Toast notifications ---- */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow);
    z-index: 300;
    transform: translateY(80px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    max-width: 320px;
    pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--accent); }

/* ---- Inline status message ---- */
.status-msg {
    font-size: 0.85rem;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    margin-top: 0.75rem;
    display: none;
}
.status-msg.visible { display: block; }
.status-msg.success { background: rgba(34,197,94,0.1); color: #86efac; border: 1px solid rgba(34,197,94,0.2); }
.status-msg.error   { background: rgba(239,68,68,0.1); color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }

/* ---- Purchases table ---- */
.purchases-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.purchases-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.purchases-table th {
    text-align: left;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.purchases-table td {
    padding: 0.75rem 0.75rem;
    border-bottom: 1px solid rgba(42,42,66,0.5);
    vertical-align: middle;
}
.purchases-table tr:last-child td { border-bottom: none; }
.purchases-table tr:hover td { background: rgba(255,255,255,0.02); }

.pur-bot-name { font-weight: 600; color: var(--text); }
.pur-bot-slug { font-size: 0.75rem; color: var(--muted); margin-top: 1px; }
.pur-date { color: var(--muted); white-space: nowrap; }
.pur-amount { font-weight: 600; white-space: nowrap; }
.pur-dl-count { color: var(--muted); text-align: center; }

.tier-chip {
    background: rgba(99,102,241,0.12);
    color: #a5b4fc;
    border: 1px solid rgba(99,102,241,0.22);
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    white-space: nowrap;
}

.btn-dl-link {
    background: rgba(34,197,94,0.1);
    color: #86efac;
    border: 1px solid rgba(34,197,94,0.2);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    text-decoration: none;
    white-space: nowrap;
    display: inline-block;
}
.btn-dl-link:hover { background: rgba(34,197,94,0.18); text-decoration: none; color: #86efac; }
.btn-dl-link.disabled { opacity: 0.4; cursor: default; pointer-events: none; }

/* Invoice status badges */
.inv-status {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.inv-status.status-paid {
    background: rgba(34,197,94,0.1);
    color: #86efac;
    border: 1px solid rgba(34,197,94,0.2);
}
.inv-status.status-refunded {
    background: rgba(245,158,11,0.1);
    color: #fcd34d;
    border: 1px solid rgba(245,158,11,0.2);
}
.inv-status.status-pending {
    background: rgba(99,102,241,0.1);
    color: #a5b4fc;
    border: 1px solid rgba(99,102,241,0.2);
}

/* ---- Privacy & Data tab ---- */
.privacy-section { margin-bottom: 1.25rem; }
.privacy-section-title {
    font-weight: 700;
    font-size: 0.925rem;
    margin-bottom: 0.4rem;
    color: var(--text);
}
.privacy-section-desc {
    color: var(--muted);
    font-size: 0.875rem;
    margin-bottom: 0.9rem;
    line-height: 1.5;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .acct-header-nav { display: none; }
    .bot-grid { grid-template-columns: 1fr 1fr; }
    .sub-actions { flex-direction: column; }
    .modal-actions { flex-direction: column; }
    .acct-tabs { overflow-x: auto; }
    .tab-btn { padding: 0.65rem 0.9rem; }
    .purchases-table th, .purchases-table td { padding: 0.55rem 0.4rem; font-size: 0.8rem; }
    .pur-date { display: none; }
}
