/*
 * Sign in, sign up, two-factor and password reset.
 *
 * Moved out of wyldcards.css by scripts/css-split.cjs (see there), in their
 * order. Loads right after wyldcards.css; the page lists it in its <head> with
 * data-page-sheet, and page-chrome.js loads it on htmx-boosted visits.
 */

.login-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    margin-bottom: calc(0.85rem * var(--wc-density));
    border: 1px solid var(--border);
    border-radius: var(--wc-radius-round);
    background: var(--accent-bg);
    color: var(--login-ink, #0c1222);
}

.login-eyebrow {
    margin: 0 0 calc(0.35rem * var(--wc-density));
    font-size: var(--wc-text-xs);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--login-ink, #0c1222);
}

.login-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--wc-space-3);
    width: 100%;
}

.login-forgot {
    font-size: var(--wc-text-caption);
    font-weight: 400;
    color: var(--muted-fg);
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-forgot:hover,
.login-forgot:focus-visible {
    color: var(--login-focus, var(--login-ink, #0c1222));
    text-decoration: underline;
}

.login-reveal {
    position: absolute;
    top: 50%;
    right: 0.4rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: var(--wc-radius-md);
    background: transparent;
    /* base.css gives every button a drop shadow; here it drew a raised box
       around a mark that is meant to sit flat inside the field. */
    box-shadow: none;
    color: var(--muted-fg);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.login-reveal:hover {
    color: var(--login-ink, #0c1222);
    background: var(--accent-bg);
}

.login-reveal:focus-visible {
    outline-offset: 1px;
    color: var(--login-ink, #0c1222);
}

/* One icon or the other, never both — the button swaps which is hidden. */
.login-reveal .login-reveal-off { display: none; }
.login-reveal[aria-pressed="true"] .login-reveal-on { display: none; }
.login-reveal[aria-pressed="true"] .login-reveal-off { display: block; }

.invite-email-note {
    margin: 0 0 var(--wc-space-3);
    font-size: var(--wc-text-sm);
}
/* --- Passkeys: login button + management page (styles live here, not in the
   page <head>, because HTMX-boosted swaps replace only <body>) --- */
.login-passkey { margin-top: var(--wc-space-4); }
.login-passkey-divider {
    display: flex; align-items: center; gap: var(--wc-space-3);
    margin-bottom: var(--wc-space-4); color: var(--muted-fg); font-size: var(--wc-text-sm);
}
.login-passkey-divider::before, .login-passkey-divider::after {
    content: ""; flex: 1; border-top: 1px solid currentColor; opacity: 0.35;
}
.login-passkey-button { width: 100%; }

/* The passkey button borrows .login-submit for its shape but not its weight:
   two identically solid buttons stacked read as two primary actions, and only
   one of them is. Specificity here matches the dark-theme .login-submit rules
   further up, which is what these have to out-rank rather than merely follow. */
.login-passkey .login-passkey-button,
:root.-dark-theme .login-passkey .login-passkey-button {
    background: transparent;
    border-color: var(--border);
    /* !important because .login-submit's white (dark theme: page-ground) ink is,
       and without it this label was drawn in the button's own transparent
       ground — invisible in both themes. */
    color: var(--fg) !important;
    box-shadow: none;
}

.login-passkey .login-passkey-button:hover,
:root.-dark-theme .login-passkey .login-passkey-button:hover {
    background: var(--accent-bg);
    border-color: var(--login-focus, var(--login-ink, #0c1222));
    color: var(--login-focus, var(--login-ink, #0c1222)) !important;
    box-shadow: none;
}

:root.-dark-theme .login-passkey .login-passkey-button {
    border-color: rgba(255, 255, 255, 0.22);
    color: var(--login-ink, #e8eef8) !important;
}

:root.-dark-theme .login-passkey .login-passkey-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff !important;
}

@media (prefers-color-scheme: dark) {
    :root:not(.-no-dark-theme) .login-passkey .login-passkey-button {
        background: transparent;
        border-color: rgba(255, 255, 255, 0.22);
        color: var(--login-ink, #e8eef8) !important;
        box-shadow: none;
    }

    :root:not(.-no-dark-theme) .login-passkey .login-passkey-button:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.45);
        color: #fff !important;
        box-shadow: none;
    }
}
.login-passkey #passkey-error,
.login-passkey #passkey-status { margin-top: var(--wc-space-3); }
