/* cantv account menu, v7 (www.cantv.us/account-menu/v7/): goes with account-menu.js in this folder.
   Files under a version folder never change once live; a change ships as a new folder.
   A sign-in icon, or your avatar (photo, or your initial in the pixel font) opening
   your account menu, in a dark glass style. Drawn for a dark page. */
.account,
.tvacct {
    --account-ease: cubic-bezier(0.22, 1, 0.36, 1);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter",
                 Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    line-height: normal;
    text-align: left;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.account *,
.account *::before,
.account *::after,
.tvacct *,
.tvacct *::before,
.tvacct *::after {
    box-sizing: border-box;
}

.account {
    position: relative;     /* the menu opens under it, right-aligned; where the icon sits is the page's call */
    transition: opacity 0.35s ease, visibility 0s;
}

.account.is-pending {       /* until my.cantv.us answers (or fails to) */
    opacity: 0;
    visibility: hidden;
}

.account__signin,
.account__toggle {
    display: block;
    padding: 6px;           /* a bigger tap target… */
    margin: -6px;           /* …without moving the tile */
    border: 0;
    background: none;
    color: rgba(255, 255, 255, 0.55);
    font: inherit;
    outline: none;          /* the tile shows focus instead */
    -webkit-tap-highlight-color: transparent;
}

.account__tile {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 32px;
    height: 32px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    transition: color 0.3s ease, border-color 0.3s ease;
}

.account__signin:hover,
.account__signin:focus-visible,
.account__toggle:hover,
.account__toggle:focus-visible,
.account.is-open .account__toggle {
    color: #fff;
}

.account__signin:hover .account__tile,
.account__toggle:hover .account__tile,
.account.is-open .account__tile {
    border-color: rgba(255, 255, 255, 0.4);
}

.account__signin:focus-visible .account__tile,
.account__toggle:focus-visible .account__tile {
    outline: 2px solid var(--accent, #a78bfa);
    outline-offset: 2px;
}

.account__person {          /* 8×9 pixel person, 2px per pixel */
    width: 16px;
    height: 18px;
    fill: currentColor;
    shape-rendering: crispEdges;
}

.account__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* No photo: your initial, in the pixel font and this visit's cursor colour */
.account__initial {
    color: var(--accent, #a78bfa);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.account__initial svg {
    display: block;
    width: calc(var(--gw) * var(--u, calc(2px / 89)));    /* --gw/--gh: the letter's own size, in font units */
    height: calc(var(--gh) * var(--u, calc(2px / 89)));
    fill: currentColor;
    shape-rendering: crispEdges;
}

.account__menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 210px;
    max-width: min(280px, calc(100vw - 36px));
    max-height: calc(100vh - 80px);     /* a long menu scrolls inside itself */
    max-height: calc(100svh - 80px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    background: rgba(15, 15, 20, 0.65);
    -webkit-backdrop-filter: blur(15px) saturate(1.5);
    backdrop-filter:         blur(15px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;         /* also keeps the closed links out of the tab order */
    translate: 0 -4px;
    transition: opacity 0.18s ease, translate 0.25s var(--account-ease), visibility 0s linear 0.25s;
}

.account.is-open .account__menu {
    opacity: 1;
    visibility: inherit;        /* so it still disappears when the page hides the account icon */
    translate: 0 0;
    transition: opacity 0.18s ease, translate 0.25s var(--account-ease), visibility 0s;
}

.account__who {               /* your picture, name and @username */
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 11px;
}

.account__who .account__tile { flex: none; }

.account__ids {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;               /* lets a long name shorten with "…" */
}

.account__name,
.account__handle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account__name   { color: rgba(255, 255, 255, 0.92); font-size: 14px; font-weight: 600; }
.account__handle { color: rgba(255, 255, 255, 0.55); font-size: 12.5px; }

/* Your plan, a small pill under your name ("Member · 23 days left" + "AI Pro") */
.account__menu .account__plan {
    display: inline-flex;
    align-self: flex-start;
    gap: 6px;
    max-width: 100%;
    width: auto;
    margin-top: 4px;
    padding: 1px 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 11px;
    line-height: 16px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.account__menu .account__plan::before { content: none; }
.account__menu .account__plan.is-muted { color: rgba(255, 255, 255, 0.4); }
.account__menu a.account__plan:hover,
.account__menu a.account__plan:focus-visible { color: #fff; border-color: var(--accent, #a78bfa); }
.account__plan > span { overflow: hidden; text-overflow: ellipsis; }
.account__plan-ai { flex: none; color: var(--accent, #a78bfa); }

.account__group {
    padding: 5px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.account__heading {            /* "ai", "account", "admin" */
    display: block;
    padding: 4px 14px 2px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
    line-height: 15px;
    letter-spacing: 0.04em;
}

.account__menu a,
.account__menu .account__item {    /* the watch group's "tv code" row is a button styled as a link */
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    border: 0;
    background: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    padding: 6px 14px 6px 24px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    line-height: 18px;
    letter-spacing: 0.02em;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    outline: none;              /* the pixel ">" and white text show focus */
    transition: color 0.3s ease;
}

/* A pixel ">" marks the item you're on, like a terminal's selection */
.account__menu a::before,
.account__menu .account__item::before {
    content: "";
    position: absolute;
    top: 11px;
    left: 12px;
    width: 5px;
    height: 7px;
    background: var(--accent, #a78bfa);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 7'%3E%3Cpath d='M0 0h2v1h1v1h1v1h1v1h-1v1h-1v1h-1v1h-2v-1h1v-1h1v-1h1v-1h-1v-1h-1v-1h-1z'/%3E%3C/svg%3E") no-repeat;
    mask:         url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 7'%3E%3Cpath d='M0 0h2v1h1v1h1v1h1v1h-1v1h-1v1h-1v1h-2v-1h1v-1h1v-1h1v-1h-1v-1h-1v-1h-1z'/%3E%3C/svg%3E") no-repeat;
    opacity: 0;
    translate: -3px 0;
    transition: opacity 0.18s ease, translate 0.25s var(--account-ease);
}

.account__menu a:hover,
.account__menu a:focus-visible,
.account__menu .account__item:hover,
.account__menu .account__item:focus-visible,
.account__menu .account__item[aria-expanded="true"] {
    color: #fff;
}

.account__menu a:hover::before,
.account__menu a:focus-visible::before,
.account__menu .account__item:hover::before,
.account__menu .account__item:focus-visible::before,
.account__menu .account__item[aria-expanded="true"]::before {
    opacity: 1;
    translate: 0 0;
}

.account__menu .account__signout:hover,
.account__menu .account__signout:focus-visible { color: #f87171; }
.account__menu .account__signout::before       { background: #f87171; }

/* "tv account": a small glass popup with your cantv watch username and password */
.tvacct {
    position: fixed;
    inset: 0;
    z-index: 960;               /* homepage: above the console (900), below the card popup (1000) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.5);
}
.tvacct[hidden] { display: none; }

.tvacct__panel {
    width: min(340px, 100%);
    max-height: calc(100svh - 32px);
    overflow-y: auto;
    padding: 14px 16px 16px;
    background: rgba(15, 15, 20, 0.85);
    -webkit-backdrop-filter: blur(15px) saturate(1.5);
    backdrop-filter:         blur(15px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    line-height: 18px;
}

.tvacct__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.tvacct__title { margin: 0; color: #fff; font-size: 14px; font-weight: 600; }

.tvacct__row { margin-bottom: 10px; }
.tvacct__label { margin: 0 0 3px; color: rgba(255, 255, 255, 0.4); font-size: 11px; letter-spacing: 0.04em; }
.tvacct__muted { color: rgba(255, 255, 255, 0.3); }
.tvacct__value {
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-family: ui-monospace, Consolas, monospace;
    overflow-wrap: anywhere;
    user-select: all;
}
.tvacct__secret:not(.is-shown) { color: rgba(255, 255, 255, 0.45); user-select: none; }

.tvacct__buttons { display: flex; gap: 6px; margin-top: 6px; }
.tvacct__btn,
.tvacct__close,
.tvacct__input {
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
}
.tvacct__btn,
.tvacct__close {
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.tvacct__btn[hidden] { display: none; }
.tvacct__btn:hover, .tvacct__btn:focus-visible,
.tvacct__close:hover, .tvacct__close:focus-visible,
.tvacct__toggle[aria-expanded="true"] { color: #fff; background: rgba(255, 255, 255, 0.14); border-color: var(--accent, #a78bfa); }
.tvacct__btn:disabled { opacity: 0.5; cursor: default; }

.tvacct__form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tvacct__form[hidden] { display: none; }
.tvacct__input {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 8px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
}
.tvacct__input::placeholder { color: rgba(255, 255, 255, 0.3); }
.tvacct__input:focus { border-color: var(--accent, #a78bfa); }

.tvacct__hint,
.tvacct__note,
.tvacct__status { margin: 8px 0 0; font-size: 12px; line-height: 16px; color: rgba(255, 255, 255, 0.5); }
.tvacct__hint { flex-basis: 100%; margin-top: 0; }
.tvacct__status[hidden] { display: none; }
.tvacct__status.is-ok    { color: #4ade80; }
.tvacct__status.is-error { color: #f87171; }
.tvacct__link { color: inherit; text-decoration: underline; }
.tvacct__note .tvacct__link { color: #fff; }

/* "tv code": one big 6-digit box and a "sign in" button */
.tvacct__codeform { margin-top: 12px; }
.tvacct__codeform .tvacct__code,
.tvacct__codeform .tvacct__send { height: 40px; }
.tvacct__code {
    font-size: 20px;
    letter-spacing: 0.3em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.tvacct__code::placeholder { color: rgba(255, 255, 255, 0.18); }
.tvacct__body > .tvacct__link { display: inline-block; margin-top: 8px; font-size: 12px; color: rgba(255, 255, 255, 0.5); }
.tvacct__link:hover, .tvacct__link:focus-visible { color: #fff; }

@media (max-width: 768px) {
    .tvacct__input:not(.tvacct__code) { font-size: 16px; }   /* iOS zooms into smaller inputs */
}
