/* The signed-out pages: Signin.aspx, ForgotPassword.aspx, PasswordRecovery.aspx (2026-09-26).
   Same family as the Admin app's sign-in (Admin/Login.aspx) so the two read as one product.
   Self-contained: these pages load no theme.css, jQuery or theme.js.
   SmarteBuild palette only - primary #346cb0, gray-dark #222230, gray #888c9b, light #f6f7f9,
   danger = pink #b76ba3 - tints by color-mix, no colour gradients.
   Night skin: the page head adds html.sb-dark when localStorage 'skin' = 'dark' (the app's own switch).
   Behaviour (show password, Caps Lock, one post at a time, password rules) is in auth.js. */

:root {
    --sb-primary: #346cb0;
    --sb-primary-dark: color-mix(in srgb, #346cb0 78%, #222230);
    --sb-ink: #222230;
    --sb-body: color-mix(in srgb, #222230 82%, #fff);
    --sb-muted: color-mix(in srgb, #222230 64%, #fff);
    --sb-rule: color-mix(in srgb, #888c9b 38%, #fff);
    --sb-soft-rule: color-mix(in srgb, #888c9b 22%, #fff);
    --sb-ground: #f6f7f9;
    --sb-card: #fff;
    --sb-field: #fff;
    --sb-danger: #b76ba3;
    --sb-ring: color-mix(in srgb, #346cb0 22%, transparent);
    --sb-link: #346cb0;
    --sb-link-hover: color-mix(in srgb, #346cb0 78%, #222230);
    --sb-font: 'Fira Sans', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
html.sb-dark {
    --sb-ink: #eceef2;
    --sb-body: color-mix(in srgb, #fff 80%, #222230);
    --sb-muted: color-mix(in srgb, #888c9b 85%, #fff);
    --sb-rule: color-mix(in srgb, #888c9b 45%, #222230);
    --sb-soft-rule: color-mix(in srgb, #888c9b 28%, #222230);
    --sb-ground: color-mix(in srgb, #222230 88%, #000);
    --sb-card: #222230;
    --sb-field: color-mix(in srgb, #222230 80%, #000);
    --sb-ring: color-mix(in srgb, #346cb0 45%, transparent);
    --sb-link: color-mix(in srgb, #346cb0 55%, #fff);
    --sb-link-hover: color-mix(in srgb, #346cb0 35%, #fff);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sb-font); font-size: 1rem; line-height: 1.5; color: var(--sb-body); background: var(--sb-ground); -webkit-font-smoothing: antialiased; }
a { color: var(--sb-link); text-underline-offset: .15em; }
a:hover { color: var(--sb-link-hover); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--sb-ring); outline-offset: 2px; }

.auth { display: grid; grid-template-columns: minmax(400px, 44%) 1fr; min-height: 100vh; }

/* ---- the brand panel: solid primary with a faint blueprint grid (lines, not a gradient) ---- */
.brand {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
    padding: 3rem clamp(2rem, 4vw, 4rem);
    color: #fff; background-color: var(--sb-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cpath d='M0 .5H128M.5 0V128' stroke='%23fff' stroke-opacity='.16'/%3E%3Cpath d='M0 32.5H128M0 64.5H128M0 96.5H128M32.5 0V128M64.5 0V128M96.5 0V128' stroke='%23fff' stroke-opacity='.07'/%3E%3C/svg%3E");
}
.brand-logo img { display: block; width: 220px; max-width: 100%; height: auto; }
.brand-copy { max-width: 28rem; }
.eyebrow { margin: 0 0 .75rem; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.brand h2 { margin: 0 0 2rem; font-size: clamp(1.7rem, 1.2rem + 1.4vw, 2.35rem); line-height: 1.2; font-weight: 600; text-wrap: balance; }

/* A real sequence (the stages of a job; the steps of a reset), so it is drawn as one:
   numbered stops on a line. On the reset pages the steps carry is-done / is-current. */
.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.stages li { position: relative; display: grid; grid-template-columns: 2.25rem 1fr; column-gap: .9rem; padding-bottom: 1.35rem; }
.stages li:last-child { padding-bottom: 0; }
.stages li::before {                      /* the line joining the stops */
    content: ''; position: absolute; left: 1.125rem; top: 2.25rem; bottom: 0; width: 2px;
    transform: translateX(-1px); background: rgba(255, 255, 255, .28);
}
.stages li:last-child::before { display: none; }
.stop {
    width: 2.25rem; height: 2.25rem; border-radius: 50%;
    display: grid; place-items: center;
    font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums;
    color: var(--sb-primary); background: #fff;
}
.stage-name { margin: .1rem 0 .1rem; font-size: 1.08rem; font-weight: 600; line-height: 1.3; }
.stage-what { margin: 0; font-size: .93rem; line-height: 1.45; opacity: .86; }

.steps li .stop { color: #fff; background: transparent; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); }
.steps li.is-done .stop { color: var(--sb-primary); background: rgba(255, 255, 255, .7); box-shadow: none; }
.steps li.is-current .stop { color: var(--sb-primary); background: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, .22); }
.steps li:not(.is-current) .stage-name, .steps li:not(.is-current) .stage-what { opacity: .72; }
.steps li.is-current .stage-what { opacity: .92; }

.brand-foot { margin: 0; font-size: .95rem; opacity: .92; }
.brand-foot a { color: #fff; font-weight: 500; }
.brand-foot a:hover { color: #fff; opacity: .85; }

/* ---- the form side ---- */
.main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem; padding: 2.5rem 1.5rem; }
.card { width: 100%; max-width: 26rem; background: var(--sb-card); border: 1px solid var(--sb-soft-rule); border-radius: 1rem;
        box-shadow: 0 2px 6px rgba(34, 34, 48, .06), 0 12px 32px rgba(34, 34, 48, .07); padding: 2.5rem; }
.card-logo { display: none; width: 180px; height: auto; margin: 0 0 1.75rem; }
html.sb-dark .card-logo { filter: brightness(0) invert(1); }
h1 { margin: 0 0 .4rem; font-size: 1.75rem; line-height: 1.2; font-weight: 600; color: var(--sb-ink); }
.lede { display: block; margin: 0 0 1.75rem; color: var(--sb-muted); font-size: .95rem; text-wrap: pretty; }

.alert { display: block; margin: 0 0 1.25rem; padding: .75rem .9rem; border-radius: .5rem; font-size: .92rem; color: var(--sb-ink);
         background: color-mix(in srgb, var(--sb-danger) 11%, var(--sb-card)); border-left: 4px solid var(--sb-danger); }
.alert.alert-info { background: color-mix(in srgb, var(--sb-primary) 10%, var(--sb-card)); border-left-color: var(--sb-primary); }
.alert:empty { display: none; }
h1 + .alert { margin-top: 1rem; }         /* a message in place of the grey line under the heading */           /* a server label with no message renders as an empty span */
.alert a { color: var(--sb-ink); font-weight: 600; }

.field { margin: 0 0 1.25rem; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
label { display: block; margin: 0 0 .4rem; font-size: .9rem; font-weight: 500; color: var(--sb-ink); }
.label-note { font-weight: 400; color: var(--sb-muted); }
.field-head a { font-size: .88rem; }
.input { display: block; width: 100%; height: 3rem; padding: 0 .9rem; font: inherit; font-size: 1rem; color: var(--sb-ink); background: var(--sb-field);
         border: 1px solid var(--sb-rule); border-radius: .625rem; transition: border-color .15s, box-shadow .15s; }
.input:hover { border-color: color-mix(in srgb, #888c9b 60%, var(--sb-card)); }
.input:focus { outline: none; border-color: var(--sb-primary); box-shadow: 0 0 0 3px var(--sb-ring); }
.password { position: relative; }
.password .input { padding-right: 4.5rem; }
.show-pw { position: absolute; top: 50%; right: .4rem; transform: translateY(-50%); padding: .35rem .6rem; border: 0; border-radius: .4rem;
           background: transparent; color: var(--sb-link); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.show-pw:hover { background: color-mix(in srgb, #346cb0 9%, var(--sb-card)); }
.caps, .field-note { margin: .45rem 0 0; font-size: .85rem; color: var(--sb-muted); }
.caps { display: none; }
.caps.on { display: block; }

/* Password rules, ticked as they are met (auth.js). The same four checks as Functions.ValidatePassword. */
.rules { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .3rem .75rem; font-size: .85rem; color: var(--sb-muted); }
.rules li { display: flex; align-items: center; gap: .45rem; }
.rules li::before {
    content: ''; flex: none; width: .95rem; height: .95rem; border-radius: 50%;
    box-shadow: inset 0 0 0 1.5px var(--sb-rule);
}
.rules li.met { color: var(--sb-ink); }
.rules li.met::before {
    box-shadow: none; background-color: var(--sb-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.sr-state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.match { display: none; }
.match.on { display: block; }

.submit { display: block; width: 100%; height: 3rem; margin: .5rem 0 0; border: 0; border-radius: .625rem; cursor: pointer;
          background: var(--sb-primary); color: #fff; font: inherit; font-size: 1rem; font-weight: 600; transition: background-color .15s; }
.submit:hover { background: var(--sb-primary-dark); }
.submit[aria-busy="true"] { cursor: progress; background: var(--sb-primary-dark); }

.agree { margin: .9rem 0 0; font-size: .82rem; line-height: 1.45; color: var(--sb-muted); text-align: center; text-wrap: balance; }
.agree a { color: var(--sb-muted); }

.alt { margin: 1.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--sb-soft-rule); font-size: .92rem; text-align: center; color: var(--sb-muted); }
.alt p { margin: 0; text-wrap: pretty; }
.alt p + p { margin-top: .4rem; }
.account-link { display: none; }
.footer { font-size: .85rem; color: var(--sb-muted); text-align: center; }
.footer a { color: var(--sb-muted); }
.footer a:hover { color: var(--sb-ink); }
.footer span { margin: 0 .45rem; }

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .brand { display: none; }
    .card-logo { display: block; }
    .alt .account-link { display: block; }
    .main { justify-content: flex-start; padding-top: 3rem; }
}
@media (max-width: 480px) {
    .main { padding: 1.5rem 1rem; }
    .card { padding: 1.75rem 1.25rem; border-radius: .75rem; }
    .rules { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .input, .submit { transition: none; }
}
