/* ============================================================================
   Narrative Geometry — auth layer
   Loads AFTER narrative-geometry.css and reuses its --ng-* tokens.
   Scoped under .ng-auth.
   ========================================================================= */

.ng-auth {
    --ng-ok: #3f7d58;
    --ng-ok-bg: #e8f1ec;
    --ng-bad: #a4453c;
    --ng-bad-bg: #f7e8e6;

    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 56px 24px 88px;
    min-height: 100%;
}

/* ---------------------------------------------------------------- card */

.ng-auth__card {
    width: 100%;
    max-width: 880px;
    background: var(--ng-paper);
    border: 1px solid var(--ng-rule);
    border-radius: var(--ng-r);
    box-shadow: 0 24px 60px -30px rgba(11,39,64,.28);
    overflow: hidden;
}

.ng-auth__head {
    padding: 34px 38px 28px;
    background: var(--ng-paper-warm);
    border-bottom: 1px solid var(--ng-rule);
}

.ng-auth__glyph {
    width: 26px;
    height: 26px;
    color: var(--ng-wine);
    fill: currentColor;
    margin-bottom: 14px;
}

.ng-auth__title {
    font-family: var(--ng-display);
    font-size: clamp(1.9rem, 4vw, 2.5rem);
    line-height: 1.1;
    margin: 0 0 .6rem;
}

    .ng-auth__title em {
        font-style: italic;
        color: var(--ng-wine);
    }

.ng-auth__lede {
    color: var(--ng-ink-soft);
    font-size: 1rem;
    margin: 0;
    max-width: 54ch;
}

/* two-column body, stacks under 760px */
.ng-auth__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, .82fr);
}

@media (max-width: 760px) {
    .ng-auth__body {
        grid-template-columns: minmax(0, 1fr);
    }

    .ng-auth__spine {
        display: none;
    }
}

.ng-auth__spine {
    background: var(--ng-rule);
}

.ng-auth__pane {
    padding: 32px 38px 38px;
}

.ng-auth__pane--alt {
    background: rgba(242,236,223,.42);
}

@media (max-width: 760px) {
    .ng-auth__pane--alt {
        border-top: 1px solid var(--ng-rule);
    }
}

.ng-auth__paneTitle {
    font-family: var(--ng-mono);
    font-size: .64rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ng-ink-faint);
    margin: 0 0 22px;
}

/* ---------------------------------------------------------------- fields */

.ng-auth__field {
    margin-bottom: 18px;
}

.ng-auth__label {
    display: block;
    font-family: var(--ng-mono);
    font-size: .62rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ng-ink-faint);
    margin-bottom: .4rem;
}

.ng-auth__input {
    display: block;
    width: 100%;
    font-family: var(--ng-body);
    font-size: .95rem;
    color: var(--ng-ink);
    background: #fff;
    border: 1px solid var(--ng-rule);
    border-radius: var(--ng-r-sm);
    padding: .68rem .8rem;
    line-height: 1.4;
    transition: border-color .14s ease, box-shadow .14s ease;
}

    .ng-auth__input::placeholder {
        color: var(--ng-ink-faint);
    }

    .ng-auth__input:focus {
        outline: none;
        border-color: var(--ng-wine);
        box-shadow: 0 0 0 3px rgba(124,43,74,.14);
    }

    .ng-auth__input.input-validation-error {
        border-color: var(--ng-bad);
    }

/* Chrome's autofill yellow/blue wrecks the palette. This keeps the paper look
   without touching the value. */
.ng-auth__input:-webkit-autofill,
.ng-auth__input:-webkit-autofill:hover,
.ng-auth__input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ng-ink);
    -webkit-box-shadow: 0 0 0 40px #fff inset;
    box-shadow: 0 0 0 40px #fff inset;
    caret-color: var(--ng-ink);
}

/* password field with a reveal button */
.ng-auth__inputWrap {
    position: relative;
}

    .ng-auth__inputWrap .ng-auth__input {
        padding-right: 2.8rem;
    }

.ng-auth__reveal {
    position: absolute;
    top: 50%;
    right: .45rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--ng-ink-faint);
    border-radius: var(--ng-r-sm);
    cursor: pointer;
    font-size: .85rem;
}

    .ng-auth__reveal:hover {
        color: var(--ng-wine);
        background: var(--ng-wine-tint);
    }

/* validation text */
.ng-auth__error {
    display: block;
    font-size: .8rem;
    color: var(--ng-bad);
    margin-top: .35rem;
}

.ng-auth__summary {
    margin-bottom: 20px;
}

    .ng-auth__summary ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .ng-auth__summary li {
        font-size: .875rem;
    }

    .ng-auth__summary:empty,
    .ng-auth__summary .validation-summary-valid {
        display: none;
    }

/* ---------------------------------------------------------------- remember */

.ng-auth__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.ng-auth__check {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-size: .875rem;
    color: var(--ng-ink-soft);
    cursor: pointer;
    user-select: none;
}

    .ng-auth__check input[type="checkbox"] {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
    }

.ng-auth__box {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    border: 1px solid var(--ng-rule);
    border-radius: 4px;
    background: #fff;
    position: relative;
    transition: background .14s ease, border-color .14s ease;
}

    .ng-auth__box::after {
        content: "";
        position: absolute;
        left: 5px;
        top: 1px;
        width: 5px;
        height: 10px;
        border: solid #fff;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg) scale(0);
        transition: transform .14s ease;
    }

.ng-auth__check input:checked ~ .ng-auth__box {
    background: var(--ng-wine);
    border-color: var(--ng-wine);
}

    .ng-auth__check input:checked ~ .ng-auth__box::after {
        transform: rotate(45deg) scale(1);
    }

.ng-auth__check input:focus-visible ~ .ng-auth__box {
    box-shadow: 0 0 0 3px rgba(124,43,74,.26);
}

/* ---------------------------------------------------------------- links */

.ng-auth__link {
    font-size: .875rem;
    color: var(--ng-wine);
    text-decoration: none;
    border-bottom: 1px solid rgba(124,43,74,.28);
    padding-bottom: 1px;
}

    .ng-auth__link:hover {
        color: var(--ng-wine-deep);
        border-bottom-color: var(--ng-wine-deep);
    }

/* ---------------------------------------------------------------- submit */

.ng-auth__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    width: 100%;
    font-family: var(--ng-body);
    font-size: .95rem;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background: var(--ng-wine);
    border: 1px solid var(--ng-wine);
    border-radius: var(--ng-r-sm);
    padding: .85rem 1.2rem;
    cursor: pointer;
    transition: background .15s ease, transform .12s ease;
}

    .ng-auth__submit:hover {
        background: var(--ng-wine-deep);
        border-color: var(--ng-wine-deep);
    }

    .ng-auth__submit:active {
        transform: translateY(1px);
    }

    .ng-auth__submit:disabled {
        opacity: .65;
        cursor: progress;
    }

/* ============================================================================
   GOOGLE SIGN-IN BUTTON
   Built to Google's Identity branding guidelines: their four-colour mark at
   18px, unmodified, on a white surface with a 1px #747775 border, Roboto
   Medium at 14px, and the exact string "Sign in with Google". Do not restyle
   the colours or retype the label — the guidelines are a condition of use and
   users recognise the button by sight.
   ========================================================================= */

.ng-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #747775;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Roboto', var(--ng-body);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .25px;
    color: #1f1f1f;
    transition: background .15s ease, box-shadow .15s ease;
}

    .ng-google:hover {
        background: #f7f8f8;
        box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
    }

    .ng-google:active {
        background: #f1f2f3;
    }

    .ng-google:focus-visible {
        outline: 2px solid #0b57d0;
        outline-offset: 2px;
    }

.ng-google__mark {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
}

.ng-google__label {
    white-space: nowrap;
}

/* generic fallback provider button, for anything that isn't Google */
.ng-auth__provider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    width: 100%;
    font-family: var(--ng-body);
    font-size: .9rem;
    font-weight: 500;
    color: var(--ng-ink);
    background: #fff;
    border: 1px solid var(--ng-rule);
    border-radius: var(--ng-r-sm);
    padding: .68rem 1rem;
    cursor: pointer;
    transition: border-color .14s ease, background .14s ease;
}

    .ng-auth__provider:hover {
        border-color: var(--ng-ink-faint);
        background: var(--ng-paper-warm);
    }

.ng-auth__providerStack {
    display: grid;
    gap: 10px;
}

/* ---------------------------------------------------------------- notes */

.ng-auth__note {
    font-size: .82rem;
    color: var(--ng-ink-soft);
    line-height: 1.6;
    margin: 0;
}

.ng-auth__divider {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin: 22px 0;
    font-family: var(--ng-mono);
    font-size: .6rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ng-ink-faint);
}

    .ng-auth__divider::before,
    .ng-auth__divider::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--ng-rule);
    }

/* closed-registration callout */
.ng-auth__gate {
    border: 1px solid var(--ng-rule);
    border-radius: var(--ng-r-sm);
    background: #fff;
    padding: 14px 16px;
}

.ng-auth__gateTitle {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--ng-mono);
    font-size: .62rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ng-wine);
    margin-bottom: .5rem;
}

/* ---------------------------------------------------------------- notices */

.ng-auth__notice {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .8rem 1rem;
    border-radius: var(--ng-r-sm);
    font-size: .875rem;
    border: 1px solid;
    margin-bottom: 20px;
}

.ng-auth__notice--ok {
    background: var(--ng-ok-bg);
    border-color: rgba(63,125,88,.3);
    color: #2c5a3f;
}

.ng-auth__notice--bad {
    background: var(--ng-bad-bg);
    border-color: rgba(164,69,60,.3);
    color: #7d332c;
}

/* ---------------------------------------------------------------- footer */

.ng-auth__foot {
    padding: 18px 38px;
    border-top: 1px solid var(--ng-rule);
    background: var(--ng-paper-warm);
    font-family: var(--ng-mono);
    font-size: .66rem;
    letter-spacing: .06em;
    color: var(--ng-ink-faint);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    justify-content: space-between;
}

    .ng-auth__foot a {
        color: var(--ng-ink-faint);
        text-decoration: none;
        border-bottom: 1px solid transparent;
    }

        .ng-auth__foot a:hover {
            color: var(--ng-wine);
            border-bottom-color: rgba(124,43,74,.3);
        }

@media (max-width: 560px) {
    .ng-auth {
        padding: 26px 14px 56px;
    }

    .ng-auth__head,
    .ng-auth__pane,
    .ng-auth__foot {
        padding-left: 22px;
        padding-right: 22px;
    }
}

/* ============================================================================
   SINGLE-COLUMN VARIANT
   For the short flows — forgot password, confirmations, lockout, resets.
   ========================================================================= */

.ng-auth__card--narrow {
    max-width: 520px;
}

.ng-auth__body--single {
    grid-template-columns: minmax(0, 1fr);
}

/* ---------------------------------------------------------------- status disc */

.ng-auth__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 1.05rem;
    margin-bottom: 16px;
}

.ng-auth__status--sent {
    color: var(--ng-ok);
    background: var(--ng-ok-bg);
    border: 1px solid rgba(63,125,88,.28);
}

.ng-auth__status--key {
    color: var(--ng-wine);
    background: var(--ng-wine-tint);
    border: 1px solid rgba(124,43,74,.24);
}

/* ---------------------------------------------------------------- what next */

.ng-auth__steps {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ng-auth__step {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: .7rem;
    padding: .8rem 0;
    border-top: 1px solid var(--ng-rule);
    font-size: .875rem;
    color: var(--ng-ink-soft);
}

    .ng-auth__step:last-child {
        border-bottom: 1px solid var(--ng-rule);
    }

.ng-auth__stepN {
    font-family: var(--ng-mono);
    font-size: .66rem;
    color: var(--ng-wine);
    padding-top: .22rem;
}

.ng-auth__step strong {
    display: block;
    font-weight: 600;
    color: var(--ng-ink);
    margin-bottom: .1rem;
}

/* ---------------------------------------------------------------- back link */

.ng-auth__back {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-family: var(--ng-mono);
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ng-ink-faint);
    text-decoration: none;
    margin-top: 22px;
}

    .ng-auth__back:hover {
        color: var(--ng-wine);
    }

/* ============================================================================
   PASSWORD STRENGTH + MATCH
   Both are advisory only. The server's IdentityOptions are the real rules —
   these never claim to be them.
   ========================================================================= */

.ng-auth__meter {
    margin-top: .55rem;
}

.ng-auth__meterTrack {
    display: flex;
    gap: 4px;
}

.ng-auth__meterSeg {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: var(--ng-rule);
    transition: background .2s ease;
}

.ng-auth__meter[data-level="1"] .ng-auth__meterSeg:nth-child(1) { background: #c2564d; }

.ng-auth__meter[data-level="2"] .ng-auth__meterSeg:nth-child(-n+2) { background: #c98a35; }

.ng-auth__meter[data-level="3"] .ng-auth__meterSeg:nth-child(-n+3) { background: #9a8f3a; }

.ng-auth__meter[data-level="4"] .ng-auth__meterSeg { background: var(--ng-ok); }

.ng-auth__meterLabel {
    font-family: var(--ng-mono);
    font-size: .62rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ng-ink-faint);
    margin-top: .4rem;
}

/* live match indicator on the confirm field */
.ng-auth__match {
    display: none;
    align-items: center;
    gap: .4rem;
    font-family: var(--ng-mono);
    font-size: .64rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-top: .4rem;
}

    .ng-auth__match.is-shown {
        display: inline-flex;
    }

.ng-auth__match--ok {
    color: var(--ng-ok);
}

.ng-auth__match--no {
    color: var(--ng-bad);
}
