/* TradingBox accounts (app/account.js): top-bar buttons, account menu, Premium window. */

.account-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.acct-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13.5px;
    white-space: nowrap;
    transition: filter .15s ease, background-color .15s ease;
}

.acct-btn svg { width: 16px; height: 16px; }
.acct-btn--solid { background: var(--text); color: var(--bg); }
.acct-btn--solid:hover, .acct-btn--premium:hover { filter: brightness(1.1); }
.acct-btn--premium { color: #fff; background: linear-gradient(90deg, #7b4dff, #5a2cff); box-shadow: 0 4px 14px rgba(90, 44, 255, .3); }

.acct-avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-weight: 700;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.acct-avatar.is-premium { color: #fff; border: 0; background: linear-gradient(135deg, #cf8cff, #5a2cff); }

/* Account menu (like TradingView's): who and the plan, Support, Dark theme, Language, Sign in / out */
.acct-menu-btn { color: var(--text); }
.acct-menu {
    position: fixed;
    z-index: 1200;
    width: 280px;
    max-width: calc(100vw - 16px);
    overflow-y: auto;
    padding: 6px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
}

.acct-menu-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 8px; min-width: 0; }
.acct-menu-avatar {
    display: grid; place-items: center; flex: none;
    width: 32px; height: 32px; border-radius: 50%;
    font-weight: 700; font-size: 14px;
    color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
}
.acct-menu-avatar.is-premium { color: #fff; border: 0; background: linear-gradient(135deg, #cf8cff, #5a2cff); }
.acct-menu-who { display: grid; gap: 2px; min-width: 0; }
.acct-menu-who strong, .acct-menu-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu-who strong { font-size: 15px; }
.acct-menu-who span { color: var(--text-muted); font-size: 12.5px; }

.acct-menu-plan {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 4px 6px;
    padding: 10px;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 12.5px;
}
.acct-menu-plan.is-premium { color: var(--text); background: rgba(123, 77, 255, .12); }
.acct-menu-plan svg { width: 18px; height: 18px; color: #a78bfa; flex: none; }
.acct-menu-plan div { display: grid; gap: 2px; }
.acct-menu-plan div strong { color: var(--text); font-size: 13.5px; }
.acct-menu-plan div span { color: var(--text-muted); }

.acct-menu-sep { height: 1px; margin: 6px 4px; background: var(--border); }

.acct-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 8px;
    text-align: left;
    font-size: 14px;
    color: var(--text);
}
.acct-menu-item:hover, .acct-menu-item:focus-visible { background: var(--surface-2); outline: none; }
.acct-menu-icon { display: grid; place-items: center; width: 22px; flex: none; color: var(--text-muted); }
.acct-menu-icon:empty { display: none; }
.acct-menu-icon svg { width: 20px; height: 20px; }
.acct-menu-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu-value { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.acct-menu-chev { display: grid; color: var(--text-muted); }
.acct-menu-chev svg { width: 16px; height: 16px; }
.acct-menu-check { color: var(--accent, #2962ff); font-weight: 700; }
.acct-menu-item.is-current { font-weight: 600; }
.acct-menu-back { font-weight: 600; }
.acct-menu-item.is-accent .acct-menu-icon { color: #a78bfa; }
.acct-menu-item.is-link, .acct-menu-item.is-link .acct-menu-icon { color: var(--accent, #2962ff); }
.acct-menu-item.is-danger, .acct-menu-item.is-danger .acct-menu-icon { color: #ef4444; }

.acct-menu-item.is-disabled { opacity: .45; cursor: default; }
.acct-menu-item.is-disabled:hover { background: none; }
.acct-menu-soon { padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--text-muted); background: var(--surface-2); }

/* The Dark theme switch */
.acct-toggle {
    position: relative; flex: none;
    width: 38px; height: 22px; border-radius: 11px;
    background: var(--surface-2); border: 1px solid var(--border);
    transition: background-color .15s ease;
}
.acct-toggle::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--text-muted);
    transition: transform .15s ease, background-color .15s ease;
}
.acct-menu-switch[aria-checked="true"] .acct-toggle { background: var(--text); border-color: var(--text); }
.acct-menu-switch[aria-checked="true"] .acct-toggle::after { transform: translateX(16px); background: var(--bg); }

/* Windows */
.acct-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
    padding: 16px;
    overflow-y: auto;
    background: rgba(5, 7, 12, .6);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .18s ease;
}

.acct-backdrop.open { opacity: 1; }

.acct-modal {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 28px 24px 22px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    transform: translateY(8px) scale(.98);
    transition: transform .18s ease;
}

.acct-backdrop.open .acct-modal { transform: none; }
.acct-modal.acct-premium { max-width: 560px; }

.acct-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--text-muted);
}

.acct-close:hover { background: var(--surface-2); color: var(--text); }
.acct-close svg { width: 18px; height: 18px; }

.acct-head { display: grid; justify-items: center; gap: 6px; margin-bottom: 20px; text-align: center; }
.acct-head h2 { margin: 6px 0 0; font-size: 21px; letter-spacing: -0.01em; }
.acct-head p { margin: 0; color: var(--text-muted); font-size: 13.5px; }

.acct-crown {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #cf8cff, #5a2cff);
    box-shadow: 0 8px 24px rgba(90, 44, 255, .35);
}

.acct-crown svg { width: 24px; height: 24px; }

.acct-error {
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--down);
    background: var(--down-soft);
}

.acct-error[hidden] { display: none; }

.acct-submit {
    height: 44px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    background: linear-gradient(90deg, #7b4dff, #5a2cff);
}

.acct-submit:disabled { opacity: .6; cursor: default; }
.acct-submit--ghost { color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }

/* Sign in */
.acct-modal.acct-auth { max-width: 420px; }
.acct-view { display: grid; }
.acct-view .acct-head { margin-bottom: 18px; }
.acct-providers { display: grid; gap: 8px; }
.acct-provider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: border-color .12s, background .12s;
}
.acct-provider:hover { border-color: var(--text-muted); }
.acct-provider svg { width: 20px; height: 20px; flex: none; }
.acct-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 12px;
}
.acct-or::before, .acct-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.acct-form { display: grid; gap: 12px; }
.acct-field { display: grid; gap: 6px; }
.acct-field > span:first-child { color: var(--text-muted); font-size: 12.5px; font-weight: 600; }
.acct-input-row { position: relative; display: flex; }
.acct-input {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 16px;  /* 16px: iPhones don't zoom in on focus */
    outline: none;
    transition: border-color .12s, box-shadow .12s;
}
.acct-input::placeholder { color: var(--text-muted); opacity: .7; }
.acct-input:focus { border-color: #7b4dff; box-shadow: 0 0 0 3px rgba(123, 77, 255, .2); }
.acct-input[type="password"], .acct-input[name$="password"] { padding-right: 44px; }
.acct-eye {
    position: absolute;
    top: 6px;
    right: 6px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--text-muted);
}
.acct-eye:hover, .acct-eye.is-on { color: var(--text); background: var(--surface-2); }
.acct-eye svg { width: 17px; height: 17px; }
.acct-link {
    padding: 0;
    color: #a78bfa;
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: transparent;
    cursor: pointer;
}
.acct-link:hover { text-decoration-color: currentColor; }
.acct-forgot { justify-self: end; margin-top: -6px; font-size: 12.5px; }
.acct-switch { margin: 16px 0 0; text-align: center; color: var(--text-muted); font-size: 13px; }
.acct-auth .acct-fine { margin-top: 12px; }
.acct-view > .acct-submit { width: 100%; }
.acct-view > .acct-error { margin-top: 10px; }

/* Premium */
.acct-features { display: grid; gap: 10px; margin: 0 0 20px; padding: 0; list-style: none; }
.acct-features li { display: flex; gap: 10px; align-items: flex-start; }
.acct-features svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--up); }
.acct-features div { display: grid; gap: 2px; }
.acct-features span { color: var(--text-muted); font-size: 12.5px; }

.acct-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.acct-plan {
    position: relative;
    display: grid;
    gap: 6px;
    padding: 18px 16px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.acct-plan.is-best { border-color: #7b4dff; background: rgba(123, 77, 255, .08); box-shadow: 0 0 0 1px #7b4dff inset; }
.acct-plan .acct-submit { margin-top: 8px; }
.acct-modal.acct-premium:has(.acct-plans.is-three) { max-width: 820px; }
.acct-plans.is-three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .acct-plans.is-three { grid-template-columns: 1fr; } }
.acct-plan-tag.is-limited { color: #fca5a5; background: rgba(239, 68, 68, .14); border-color: rgba(239, 68, 68, .35); }
.acct-crypto {
    margin-top: 6px;
    padding: 4px 0;
    color: #a78bfa;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: transparent;
    cursor: pointer;
}
.acct-crypto:hover:not(:disabled) { text-decoration-color: currentColor; }
.acct-crypto:disabled { color: var(--text-muted); cursor: default; }

.acct-plan-tag {
    position: absolute;
    top: -10px;
    right: 14px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--up);
}

.acct-plan-name { color: var(--text-muted); font-size: 13px; font-weight: 600; }
.acct-plan-price { display: flex; align-items: baseline; gap: 4px; }
.acct-plan-price strong { font-size: 30px; letter-spacing: -0.02em; }
.acct-plan-price span { color: var(--text-muted); font-size: 13px; }
.acct-plan-note { color: var(--text-muted); font-size: 12px; }
.acct-plan-includes { display: grid; gap: 7px; margin: 8px 0 4px; padding: 10px 0 0; border-top: 1px solid var(--border); list-style: none; }
.acct-plan-includes li { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.35; }
.acct-plan-includes svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: #7b4dff; }
.acct-plan { display: flex; flex-direction: column; }
.acct-plan-includes { flex: 1; align-content: start; }
.acct-premium .acct-error { margin-top: 12px; }
.acct-fine { margin: 14px 0 0; text-align: center; color: var(--text-muted); font-size: 12px; }

.acct-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 1300;
    max-width: calc(100vw - 32px);
    padding: 11px 16px;
    border-radius: 12px;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--bg);
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}

@media (max-width: 560px) {
    .acct-plans { grid-template-columns: 1fr; }
    .acct-modal { padding: 24px 18px 18px; }
    .acct-btn { height: 34px; padding: 0 12px; }
    .acct-btn--premium span { display: none; }
    .acct-btn--premium { padding: 0 10px; }
}

.account-area { flex: none; }
