/* ============================================================
   account.css: the sign-in / account control in the top-right
   corner of the site header.
   ------------------------------------------------------------
   Markup comes from itl_account_control() in /php/auth.php.
   Drop it inside the header's .header-spacer div (that div is
   already pushed to the far right by sbcss-tool.css) and load
   this file after sbcss-tool.css.

   The dropdown is a native <details>/<summary>, so there is no
   JavaScript here and none is needed.
   ============================================================ */

/* ---- Signed out: the "Sign in" button ---- */
.acct-signin {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.55);
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.acct-signin svg { width: 15px; height: 15px; flex-shrink: 0; }
.acct-signin:hover {
    background: var(--sbcss-yellow, #FFDA39);
    border-color: var(--sbcss-yellow, #FFDA39);
    color: #1a1a2e;
    text-decoration: none;
}
.acct-signin:focus-visible {
    outline: 3px solid var(--sbcss-yellow, #FFDA39);
    outline-offset: 2px;
}

/* ---- Signed in: initials circle + dropdown ---- */
.acct {
    position: relative;
    line-height: 1;
}

.acct-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--sbcss-yellow, #FFDA39);
    color: #1a1a2e;
    border: 2px solid rgba(255, 255, 255, 0.5);
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* Hide the default disclosure triangle in every engine. */
    list-style: none;
}
.acct-avatar::-webkit-details-marker { display: none; }
.acct-avatar::marker { content: ''; }
.acct-avatar:hover { background: #ffe46a; }
.acct-avatar:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.acct-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 232px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    z-index: 1000;
    text-align: left;
}

.acct-menu-head {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    /* Neutral grey, equal channels, to match the page background. The hover
       state below keeps its blue tint on purpose: that one is a brand accent
       paired with the blue text, not a resting surface color. */
    background: #f7f7f7;
}
.acct-menu-name {
    display: block;
    font-size: 0.86rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}
.acct-menu-email {
    display: block;
    font-size: 0.76rem;
    color: #64748b;
    line-height: 1.4;
    word-break: break-all;
}

.acct-menu-form { margin: 0; }

.acct-menu-item {
    display: block;
    width: 100%;
    padding: 11px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.86rem;
    font-family: inherit;
    color: #334155;
    text-align: left;
    text-decoration: none;
}
.acct-menu-item:hover {
    background: #f0f6fb;
    color: var(--sbcss-blue, #026AB0);
    text-decoration: none;
}
.acct-menu-signout {
    border-top: 1px solid #e5e7eb;
    color: #b42318;
}
.acct-menu-signout:hover {
    background: #fef3f2;
    color: #912018;
}

/* Below 900px sbcss-tool.css stacks the header into a column, so the menu can
   no longer hang off the right edge without running off screen. Centre it. */
@media (max-width: 900px) {
    .acct-menu { right: 50%; transform: translateX(50%); }
}
