/* Accounts: login page, navbar account menu, Collect menu, toast, active buttons.
   Uses the --ff-* tokens from home-format.css. */

/* ---------- Navbar ---------- */
.ff-navbar-actions {
    position: relative;
}

/* Currency dropdown (figure-cards.js initCurrencyPicker), before the search box */
.ff-currency {
    height: 36px;
    padding: 0 26px 0 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--ff-text);
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23A4A9B3' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center;
    border: 1px solid var(--ff-card-border);
    border-radius: 6px;
    appearance: none;
    cursor: pointer;
    color-scheme: dark;
}

.ff-currency:hover {
    border-color: var(--ff-text-secondary);
}

.ff-currency:focus-visible {
    outline: 2px solid var(--ff-gold);
    outline-offset: 2px;
}

.ff-currency option {
    color: #fff;
    background: #0E0F11;
}

.ff-profile-btn.is-signed-in {
    box-shadow: 0 0 0 2px var(--ff-bg), 0 0 0 3px var(--ff-gold);
}

.ff-account-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 40;
    min-width: 200px;
    padding: 8px;
    background: var(--ff-card);
    border: 1px solid var(--ff-card-border);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.ff-account-menu[hidden] {
    display: none;
}

.ff-account-menu__who {
    margin: 0;
    padding: 6px 10px 10px;
    font-size: 13px;
    color: var(--ff-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-bottom: 1px solid var(--ff-card-border);
}

.ff-account-menu__item {
    display: block;
    box-sizing: border-box;
    text-decoration: none;
    width: 100%;
    margin-top: 6px;
    padding: 9px 10px;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    color: var(--ff-text);
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.ff-account-menu__item:hover,
.ff-account-menu__item:focus-visible {
    background: var(--ff-track);
    outline: none;
}

/* ---------- Toast ---------- */
.ff-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 100;
    max-width: calc(100vw - 32px);
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ff-text);
    background: var(--ff-card);
    border: 1px solid var(--ff-card-border);
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translate(-50%, 12px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ff-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- Login page ----------
   Same ledger look as the rest of the site: one hairline-framed column, text tabs with
   a gold rule, sentence-case labels and 6px controls. */
.lg-page {
    display: flex;
    justify-content: center;
    padding: 24px 16px 64px;
}

.lg-card {
    width: 100%;
    max-width: 400px;
    padding: 8px 28px 28px;
    border: 1px solid var(--ff-card-border);
    border-radius: 8px;
}

.lg-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0 0 24px;
    border-bottom: 1px solid var(--ff-line);
}

.lg-tab {
    margin-bottom: -1px;
    padding: 14px 0 12px;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--ff-text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.lg-tab:hover {
    color: var(--ff-text);
}

.lg-tab.is-active {
    color: var(--ff-text);
    border-bottom-color: var(--ff-gold);
}

.lg-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lg-form label {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ff-text);
}

.lg-form input {
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    padding: 0 12px;
    font: inherit;
    font-size: 15px;
    color: var(--ff-text);
    background: var(--ff-track);
    border: 1px solid var(--ff-card-border);
    border-radius: 6px;
    color-scheme: dark;
}

.lg-form input:hover:not(:focus) {
    border-color: var(--ff-text-secondary);
}

.lg-form input:focus {
    outline: none;
    border-color: var(--ff-gold);
}

.lg-form input:focus-visible,
.lg-tab:focus-visible,
.lg-submit:focus-visible {
    outline: 2px solid var(--ff-gold);
    outline-offset: 2px;
}

.lg-form input:focus-visible {
    outline: none;   /* the gold border is the focus ring for text boxes */
}

.lg-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lg-field[hidden] {
    display: none;
}

/* "I'm 16 or older" tick box on sign-up and account setup */
.lg-form .lg-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--ff-text);
    cursor: pointer;
}

.lg-form .lg-check[hidden] {
    display: none;
}

.lg-form .lg-check input {
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    padding: 0;
    flex-shrink: 0;
    accent-color: var(--ff-gold);
}

/* Underlined body-colour links: small gold text would be too loud for fine print */
.lg-check a {
    color: var(--ff-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.lg-hint {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--ff-text-secondary);
}

.lg-hint[hidden] {
    display: none;
}

.lg-submit {
    margin-top: 16px;
    min-height: 44px;
    padding: 0 16px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #0E0F11;
    background: var(--ff-gold);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.lg-submit:hover:not(:disabled) {
    filter: brightness(1.08);
}

.lg-submit:disabled {
    opacity: 0.6;
    cursor: wait;
}

.lg-message {
    min-height: 1.4em;
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--ff-text-secondary);
}

.lg-message.is-error {
    color: var(--ff-down);
}

.lg-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    font-size: 13px;
    color: var(--ff-text-secondary);
}

.lg-divider::before,
.lg-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ff-line);
}

/* Google's own button style: white with the coloured logo */
.lg-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 0 16px;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    color: #1f1f1f;
    background: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.lg-google:hover {
    background: #f1f3f4;
}

.lg-google:focus-visible {
    outline: 2px solid var(--ff-gold);
    outline-offset: 2px;
}

.lg-google:disabled {
    opacity: 0.6;
    cursor: wait;
}

#auth-main[hidden],
#username-setup[hidden],
#reset-request[hidden],
#reset-new[hidden] {
    display: none;
}

/* Small text buttons: "Forgot password?" and "Back to sign in" */
.lg-link {
    align-self: flex-start;
    padding: 0;
    font: inherit;
    font-size: 13px;
    color: var(--ff-text-secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
    background: none;
    border: none;
    cursor: pointer;
}

.lg-link:hover {
    color: var(--ff-text);
}

.lg-link:focus-visible {
    outline: 2px solid var(--ff-gold);
    outline-offset: 2px;
}

.lg-link[hidden],
.lg-captcha[hidden] {
    display: none;
}

/* Turnstile bot check; empty until the widget loads */
.lg-captcha {
    margin-top: 8px;
}

.lg-captcha:empty {
    margin: 0;
}

.lg-setup-title {
    margin: 16px 0 8px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.015em;
}

/* Phones: 44px to tap, as everywhere else (home-format.css covers buttons and selects) */
@media (max-width: 767px) {
    .lg-tab,
    .lg-link,
    .lg-form .lg-check {
        min-height: 44px;
    }

    .lg-link {
        display: inline-flex;
        align-items: center;
    }
}

@media (max-width: 440px) {
    /* The frame would only squeeze the form on a phone */
    .lg-card {
        padding: 0;
        border: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ff-toast {
        transition: none;
    }
}