/* ============================================================================
   SIGN-IN — the design system's signed-out page (sign in, sign out, refused,
   the emailed sign-in link, the Microsoft admin's approval, the Outlook share)
   ============================================================================

   2026-11-19, Bill: "login/logout is still your custom page, not part of css."
   It was: src/api/auth-signin-skin.js inlined the Onboard app's own stylesheet,
   with its own pinned palette, its own buttons and !important overrides for the
   email form. This sheet replaces that. It is part of the design system:

   - every colour, radius, font and shadow is a core-design-system.css token,
     so the page paints in whatever theme the engine (themes.js) puts on :root;
   - the buttons are the standard .btn-primary / .btn-secondary, the email
     field is the standard <input>; this sheet only sizes and places them;
   - nothing here is pinned to a hex. The art panel is drawn from the theme's
     accent, so it is the theme's art on Navy and on Light alike.

   Linked (not inlined) by auth-signin-skin.js SIGNED_OUT_HEAD, after
   core-design-system.css; src/auth/public-pages.js opens exactly the files that
   head names to a signed-out browser. Gate:
   src/api/__tests__/signed-out-page-is-part-of-the-design-system.test.mjs.
   ========================================================================== */

html, body { margin: 0; height: 100%; }
body { background: var(--color-bg-primary); }

.signin-page {
    min-height: 100vh;
    display: grid;
    place-items: safe center;
    padding: var(--spacing-2xl) var(--spacing-lg);
    box-sizing: border-box;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.45;
}
.signin-page *, .signin-page *::before, .signin-page *::after { box-sizing: border-box; }
.signin-page :focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ── the card: art on the left, the door on the right ───────────────────── */
.signin-card {
    display: grid;
    grid-template-columns: 46% minmax(0, 1fr);
    width: 100%;
    max-width: 1040px;
    min-height: 620px;
    padding: var(--spacing-md);
    border: 1px solid var(--color-border-normal);
    border-radius: var(--radius-xl);
    background: var(--color-bg-elevated);
    box-shadow: var(--shadow-lg);
    animation: signin-in .6s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes signin-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ── the art panel, drawn from the theme's accent ───────────────────────── */
.signin-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--spacing-3xl);
    padding: var(--spacing-2xl);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--color-accent) 10%, var(--color-bg-secondary));
    color: var(--color-text-bright);
    overflow: hidden;
    isolation: isolate;
}
.signin-aurora { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.signin-aurora i {
    position: absolute;
    border-radius: 50%;
    aspect-ratio: 1;
    filter: blur(48px);
    opacity: .55;
    animation: signin-drift 14s ease-in-out infinite alternate;
}
.signin-aurora i:nth-child(1) { left: -18%; bottom: -12%; width: 80%; background: color-mix(in srgb, var(--color-accent) 70%, transparent); }
.signin-aurora i:nth-child(2) { right: -16%; top: 30%; width: 64%; background: color-mix(in srgb, var(--color-accent-light) 55%, transparent); animation-delay: -4s; animation-duration: 17s; }
.signin-aurora i:nth-child(3) { left: 6%; top: -18%; width: 56%; background: color-mix(in srgb, var(--color-info) 40%, transparent); animation-delay: -8s; animation-duration: 12s; }
.signin-aurora i:nth-child(4) { right: 10%; bottom: 12%; width: 38%; background: color-mix(in srgb, var(--color-accent-dark) 60%, transparent); animation-delay: -2s; animation-duration: 19s; }
@keyframes signin-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(6%, -8%) scale(1.12); } }

.signin-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: var(--spacing-sm); }
.signin-mark { display: inline-block; background-position: center; background-size: contain; background-repeat: no-repeat; }

.signin-pitch { position: relative; z-index: 1; }
.signin-pitch small {
    display: block;
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-accent-ink);
}
.signin-pitch h2 { margin: 0; max-width: 16em; font-size: 30px; line-height: 1.18; font-weight: var(--font-weight-semibold); letter-spacing: -.02em; color: var(--color-text-bright); }
.signin-pitch h2 em { font-style: normal; color: var(--color-accent-ink); }

/* The floating activity cards: the standard elevated surface, tilted. */
.signin-float { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.signin-fc {
    position: absolute;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    width: 236px;
    padding: var(--spacing-md) var(--spacing-lg);
    border: 1px solid var(--color-border-normal);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--color-bg-elevated) 82%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    transform: rotate(var(--r, 0deg));
    animation: signin-fc-in .9s cubic-bezier(.2, .8, .2, 1) var(--d, 0s) both;
}
.signin-fc > span { display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; border-radius: var(--radius-md); background: var(--color-bg-secondary); }
.signin-fc > div { min-width: 0; }
.signin-fc b { display: block; font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); color: var(--color-text-bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signin-fc small { display: block; font-size: var(--font-size-xs); color: var(--color-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signin-fc:nth-child(1) { top: 21%; left: 8%; --r: -3deg; --d: .4s; }
.signin-fc:nth-child(2) { top: 34%; right: 6%; --r: 2deg; --d: .6s; }
.signin-fc:nth-child(3) { top: 48%; left: 14%; --r: 1.5deg; --d: .8s; }
.signin-fc:nth-child(4) { top: 61%; right: 10%; --r: -2deg; --d: 1s; }
@keyframes signin-fc-in { from { opacity: 0; transform: translateY(16px) rotate(var(--r, 0deg)); } to { opacity: 1; transform: rotate(var(--r, 0deg)); } }

/* ── the door ───────────────────────────────────────────────────────────── */
.signin-main { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: var(--spacing-3xl) var(--spacing-xl); }
.signin-door { width: 100%; max-width: 380px; }
.signin-door > .signin-mark { display: block; margin-bottom: var(--spacing-lg); }
.signin-door h1 { margin: 0 0 var(--spacing-md); font-size: 34px; line-height: 1.1; font-weight: var(--font-weight-semibold); letter-spacing: -.03em; color: var(--color-text-bright); }
.signin-lede { margin: 0 0 var(--spacing-2xl); font-size: var(--font-size-md); line-height: 1.5; color: var(--color-text-secondary); }
.signin-lede span { color: var(--color-text-bright); font-weight: var(--font-weight-medium); }

/* A link that is a button. core-design-system.css gives the base look (flex, radius, font) to the <button> element; the
   doors' buttons are <a href> so they work with no script, so they take the same base here, then .btn-primary/-secondary. */
.signin-page a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-base);
}

/* A provider button is the standard .btn-secondary, full width. */
.signin-sso {
    display: flex;
    width: 100%;
    height: 48px;
    justify-content: center;
    gap: var(--spacing-md);
    font-size: var(--font-size-md);
    text-decoration: none;
}
.signin-sso + .signin-sso { margin-top: var(--spacing-md); }

.signin-trust { display: flex; align-items: center; gap: var(--spacing-sm); margin: var(--spacing-xl) 0 0; font-size: var(--font-size-sm); color: var(--color-text-secondary); }
.signin-trust svg { color: var(--color-success); }
.signin-legal { margin: var(--spacing-2xl) 0 0; font-size: var(--font-size-xs); line-height: 1.5; color: var(--color-text-tertiary); }
.signin-legal-doc { color: var(--color-text-secondary); text-decoration: underline; text-underline-offset: 2px; }
.signin-link { color: var(--color-accent-ink); text-decoration: underline; text-underline-offset: 2px; }

/* The emailed sign-in link's form: the standard input and a .btn-secondary. */
.signin-email { display: flex; flex-direction: column; gap: var(--spacing-md); margin-top: var(--spacing-lg); }
.signin-email input[type="email"] { width: 100%; height: 42px; }
.signin-email .btn { width: 100%; height: 42px; justify-content: center; }

/* A notice (refused sign-in, approval outcomes, the emailed link's steps). */
.signin-notice p { margin: 0 0 var(--spacing-md); font-size: var(--font-size-md); line-height: 1.5; color: var(--color-text-secondary); }
.signin-notice .email { color: var(--color-text-bright); font-weight: var(--font-weight-medium); overflow-wrap: anywhere; }
.signin-notice .code-note { margin-top: var(--spacing-lg); font-size: var(--font-size-sm); color: var(--color-text-tertiary); }
.signin-actions { display: flex; flex-wrap: wrap; gap: var(--spacing-md); margin-top: var(--spacing-xl); }
.signin-actions .btn { flex: 1 1 auto; height: 44px; justify-content: center; font-size: var(--font-size-md); text-decoration: none; }
.signin-actions form { display: contents; }

/* ── narrow windows: the art folds above the door ───────────────────────── */
@media (max-width: 820px) {
    .signin-page { place-items: start center; }
    .signin-card { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .signin-aside { min-height: 260px; gap: var(--spacing-2xl); padding: var(--spacing-xl); }
    .signin-float { display: none; }
    .signin-pitch h2 { font-size: 22px; }
    .signin-main { padding: var(--spacing-2xl) var(--spacing-md); }
    .signin-door h1 { font-size: 26px; }
}

/* ── small windows (narrow AND short, or phone-width): the art is a slim band
   and the door tightens, so the sign-in buttons fit without scrolling ───── */
@media (max-width: 820px) and (max-height: 760px), (max-width: 480px) {
    .signin-page { padding: var(--spacing-md); }
    .signin-card { padding: var(--spacing-sm); }
    .signin-aside { min-height: 0; flex-direction: row; align-items: center; justify-content: flex-start; gap: var(--spacing-md); padding: var(--spacing-md) var(--spacing-lg); }
    .signin-pitch small { display: none; }
    .signin-pitch h2 { max-width: none; font-size: 15px; line-height: 1.3; }
    .signin-main { padding: var(--spacing-lg) var(--spacing-md); }
    .signin-door > .signin-mark { display: none !important; }
    .signin-door h1 { margin-bottom: var(--spacing-sm); font-size: 22px; }
    .signin-lede { margin-bottom: var(--spacing-lg); font-size: var(--font-size-base); }
    .signin-sso { height: 42px; }
    .signin-trust { margin-top: var(--spacing-md); }
    .signin-legal { margin-top: var(--spacing-md); }
}

@media (prefers-reduced-motion: reduce) {
    .signin-card, .signin-aurora i, .signin-fc { animation: none; }
}
