/* KRIS sign-in pages on the new portal skin. Loaded only by Views/Account/_AuthLayout.cshtml. Light scheme only. */

:root {
    --kris-ink: #073b4c;
    --kris-ink-2: #0b5876;
    --kris-primary: #0077a6;
    --kris-primary-hover: #00668f;
    --kris-primary-press: #00567a;
    --kris-primary-soft: rgba(0, 119, 166, .10);
    --kris-text: #1f2d33;
    --kris-muted: #5f6b70;
    --kris-line: #e3e8ea;
    --kris-field-line: #869398;
    --kris-canvas: #f4f7f8;
    --kris-card: #ffffff;
    --kris-sunk: #f7fafb;
    --kris-red: #c81e3a;
    --kris-red-ink: #9b1030;
    --kris-red-soft: #fdecef;
    --kris-amber-ink: #7a3d06;
    --kris-amber-soft: #fff4e0;
    --kris-bar-accent: rgba(217, 162, 27, .85);
    --kris-band: linear-gradient(120deg, #073b4c 0%, #0b5876 55%, #0077a6 100%);
    --kris-radius: 14px;
    --kris-radius-sm: 10px;
    --kris-radius-xs: 8px;
    --kris-shadow-1: 0 1px 2px rgba(16, 38, 48, .06), 0 1px 1px rgba(16, 38, 48, .04);
    --kris-shadow-2: 0 10px 30px -12px rgba(16, 38, 48, .28);
    --kris-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --kris-ease: cubic-bezier(.22, .8, .3, 1);
    --kris-fast: 160ms;
    --kauth-gold: #f0c457;
    --kauth-icon-error: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='10' fill='%23c81e3a'/%3E%3Crect x='9' y='4.5' width='2' height='7.5' rx='1' fill='%23fff'/%3E%3Ccircle cx='10' cy='14.8' r='1.3' fill='%23fff'/%3E%3C/svg%3E");
    color-scheme: light;
}

@keyframes kauth-spin { to { transform: rotate(360deg); } }
@keyframes kauth-bar { from { background-position: -50% 0; } to { background-position: 150% 0; } }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--kris-canvas); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.kauth {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--kris-canvas);
    color: var(--kris-text);
    font-family: var(--kris-font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
.kauth [hidden] { display: none !important; }
.kauth a {
    color: var(--kris-primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(0, 119, 166, .45);
    text-underline-offset: 3px;
}
.kauth a:hover { color: var(--kris-primary-hover); text-decoration-color: currentColor; }
.kauth :focus-visible { outline: 3px solid var(--kris-primary); outline-offset: 2px; }
.kauth-sr,
.kauth-contact__h {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ---------- Shell: phone first, one column; the band sits behind the brand row ---------- */
.kauth-shell {
    --kauth-gl: max(16px, env(safe-area-inset-left));
    --kauth-gr: max(16px, env(safe-area-inset-right));
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto auto;
    grid-template-areas: "brand" "main" "contact" "foot";
    min-height: 100vh;
    min-height: 100dvh;
}
.kauth-shell::before {
    content: "";
    grid-area: brand;
    z-index: -1;
    background:
        linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 48px 48px,
        linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 48px 48px,
        var(--kris-band);
    box-shadow: inset 0 -2px 0 var(--kris-bar-accent);
}

/* ---------- Brand ---------- */
.kauth-brand { grid-area: brand; min-width: 0; color: #fff; }
.kauth-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: max(12px, env(safe-area-inset-top)) var(--kauth-gr) 4px var(--kauth-gl);
}
.kauth-logo {
    display: block;
    width: auto;
    height: 44px;
    max-width: calc(100% - 108px);
    object-fit: contain;
    object-position: left center;
}
.kauth .kauth-home {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    background: rgba(4, 32, 42, .22);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    touch-action: manipulation;
    transition: background-color var(--kris-fast) var(--kris-ease), border-color var(--kris-fast) var(--kris-ease);
}
.kauth .kauth-home:hover { background: rgba(4, 32, 42, .38); border-color: rgba(255, 255, 255, .55); color: #fff; }
.kauth-home svg { display: block; width: 16px; height: 16px; }
.kauth .kauth-brand :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.kauth-intro { padding: 6px var(--kauth-gr) 18px var(--kauth-gl); }
.kauth-eyebrow { margin: 0; color: var(--kauth-gold); font-size: 12px; font-weight: 700; line-height: 1.4; letter-spacing: .14em; text-transform: uppercase; }
.kauth-name { margin: 2px 0 0; font-size: 16px; font-weight: 600; line-height: 1.3; }
.kauth-lede { display: none; }

/* ---------- Card ---------- */
.kauth-main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px var(--kauth-gr) 8px var(--kauth-gl);
}
.kauth-card {
    width: 100%;
    max-width: 440px;
    padding: 24px 20px 0;
    border: 1px solid var(--kris-line);
    border-radius: var(--kris-radius);
    background: var(--kris-card);
    box-shadow: var(--kris-shadow-1), var(--kris-shadow-2);
}
.kauth-title { margin: 0 0 20px; color: var(--kris-ink); font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }

.kauth-form { margin: 0; }
.kauth-field { margin: 0 0 18px; }
.kauth-field--pw { margin-bottom: 2px; }
.kauth-label { display: block; margin: 0 0 8px; color: var(--kris-text); font-size: 15px; font-weight: 600; line-height: 1.3; }
.kauth-input {
    display: block;
    width: 100%;
    height: 52px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--kris-field-line);
    border-radius: var(--kris-radius-sm);
    background: #fff;
    box-shadow: none;
    color: var(--kris-text);
    font: inherit;
    font-size: 17px;
    line-height: normal;
    outline: 2px solid transparent;
    outline-offset: 0;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color var(--kris-fast) var(--kris-ease), box-shadow var(--kris-fast) var(--kris-ease);
}
.kauth-input:hover { border-color: #6c797f; }
.kauth .kauth-input:focus,
.kauth .kauth-input:focus-visible {
    outline: 2px solid transparent;
    border-color: var(--kris-primary);
    box-shadow: 0 0 0 1px var(--kris-primary), 0 0 0 5px rgba(0, 119, 166, .16);
}
.kauth-input:-webkit-autofill { -webkit-text-fill-color: var(--kris-text); box-shadow: inset 0 0 0 40px #eef6fa; }
.kauth .kauth-input:-webkit-autofill:focus { box-shadow: inset 0 0 0 40px #eef6fa, 0 0 0 1px var(--kris-primary), 0 0 0 5px rgba(0, 119, 166, .16); }
.kauth-input.input-validation-error { border-color: var(--kris-red); box-shadow: 0 0 0 4px var(--kris-red-soft); }
.kauth .kauth-input.input-validation-error:focus { border-color: var(--kris-red); box-shadow: 0 0 0 1px var(--kris-red), 0 0 0 5px rgba(200, 30, 58, .16); }

/* Password with the Show/Hide button (the button is unhidden by kris-auth.js) */
.kauth-pw { position: relative; }
.kauth-pw.has-reveal .kauth-input { padding-right: 84px; }
.kauth-pw.has-reveal .kauth-input::-ms-reveal,
.kauth-pw.has-reveal .kauth-input::-ms-clear { display: none; }
.kauth-reveal {
    position: absolute;
    top: 4px;
    right: 4px;
    bottom: 4px;
    min-width: 72px;
    margin: 0;
    padding: 0 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--kris-primary);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
}
.kauth-reveal:hover { background: var(--kris-primary-soft); color: var(--kris-primary-hover); }
.kauth .kauth-reveal:focus-visible { outline: 2px solid var(--kris-primary); outline-offset: 0; }

/* Validation: classes come from the tag helpers and jQuery unobtrusive */
.kauth-error.field-validation-valid { display: none; }
.kauth-error.field-validation-error {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 8px;
    color: var(--kris-red);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}
.kauth-error.field-validation-error::before {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    background: var(--kauth-icon-error) no-repeat center / contain;
}

.kauth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid rgba(200, 30, 58, .28);
    border-radius: var(--kris-radius-sm);
    background: var(--kris-red-soft);
    color: var(--kris-red-ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}
.kauth-alert::before {
    content: "";
    flex: none;
    width: 20px;
    height: 20px;
    background: var(--kauth-icon-error) no-repeat center / contain;
}
.kauth-alert.validation-summary-valid { display: none; }
/* Guard for summary="ModelOnly": never show an empty box */
.kauth-alert:has(> ul > li:only-child[style*="none"]) { display: none; }
.kauth-alert ul { margin: 0; padding: 0; list-style: none; }
.kauth-alert li + li { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(200, 30, 58, .18); font-weight: 500; }
.kauth .kauth-alert:focus { outline: none; }
.kauth .kauth-alert:focus-visible { outline: 2px solid var(--kris-red-ink); outline-offset: 2px; }

/* Caps Lock hint: a live region that collapses while empty */
.kauth-caps { margin: 0; color: var(--kris-amber-ink); font-size: 14px; font-weight: 600; line-height: 1.4; }
.kauth-caps:not(:empty) {
    display: flex;
    align-items: center;
    gap: 8px;
    width: -webkit-fit-content;
    width: fit-content;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: var(--kris-radius-xs);
    background: var(--kris-amber-soft);
}
.kauth-caps:not(:empty)::before {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a3d06' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 4 12h4.5v4h7v-4H20z'/%3E%3Cpath d='M8.5 20h7'/%3E%3C/svg%3E") no-repeat center / contain;
}

.kauth-forgot { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.kauth-forgot a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 600; }

.kauth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 0 20px;
    border: 1px solid var(--kris-primary);
    border-radius: var(--kris-radius-sm);
    background: var(--kris-primary);
    color: #fff;
    font: inherit;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: .01em;
    box-shadow: 0 10px 22px -12px rgba(0, 119, 166, .9);
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color var(--kris-fast) var(--kris-ease), border-color var(--kris-fast) var(--kris-ease), box-shadow var(--kris-fast) var(--kris-ease), transform var(--kris-fast) var(--kris-ease);
}
.kauth-submit:hover { background: var(--kris-primary-hover); border-color: var(--kris-primary-hover); }
.kauth-submit:active { background: var(--kris-primary-press); border-color: var(--kris-primary-press); transform: translateY(1px); }
.kauth .kauth-submit:focus-visible { outline: 3px solid var(--kris-primary); outline-offset: 3px; }
.kauth-submit[aria-disabled="true"] { background: var(--kris-primary-hover); border-color: var(--kris-primary-hover); box-shadow: none; transform: none; cursor: progress; }
.kauth-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: kauth-spin .8s linear infinite;
}
.kauth-submit[aria-busy="true"] .kauth-spinner { display: block; }

.kauth-alt {
    margin: 24px -20px 0;
    padding: 10px 20px;
    border-top: 1px solid var(--kris-line);
    border-radius: 0 0 calc(var(--kris-radius) - 1px) calc(var(--kris-radius) - 1px);
    background: var(--kris-sunk);
    color: var(--kris-muted);
    font-size: 15px;
    text-align: center;
}
.kauth-alt a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* ---------- Busy: keeps the body.loading-login hook; a clear click shield with a gold progress line ---------- */
.page-loading-login { display: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100; cursor: progress; }
.page-loading-login::before {
    content: "";
    position: absolute;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(217, 162, 27, 0), #d9a21b 50%, rgba(217, 162, 27, 0)) 0 0 / 50% 100% no-repeat;
    animation: kauth-bar 1.1s linear infinite;
}
body.loading-login .page-loading-login { display: block; }
body.loading-login .kauth-input { opacity: .7; }

/* ---------- Contact and footer ---------- */
.kauth-contact {
    grid-area: contact;
    min-width: 0;
    padding: 28px var(--kauth-gr) 0 var(--kauth-gl);
    color: var(--kris-muted);
    font-size: 14px;
    text-align: center;
}
.kauth-contact__list { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 20px; margin: 0; font-style: normal; }
.kauth-contact__row { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.kauth-contact__row:first-child { flex-basis: 100%; justify-content: center; min-height: 0; margin-bottom: 2px; }
.kauth-contact__row svg { display: block; flex: none; width: 16px; height: 16px; }
.kauth a.kauth-contact__row { font-weight: 600; }

.kauth-foot {
    grid-area: foot;
    min-width: 0;
    padding: 16px var(--kauth-gr) max(24px, env(safe-area-inset-bottom)) var(--kauth-gl);
    color: var(--kris-muted);
    font-size: 13px;
    text-align: center;
}
.kauth-marks { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 0; padding: 0; list-style: none; }
.kauth-marks li { flex: 0 1 104px; min-width: 0; }
.kauth-marks img { display: block; width: 100%; height: auto; }
.kauth-copy { margin: 16px 0 0; text-wrap: balance; }

/* ---------- Tablet: phone stack, everything lined up with the card ---------- */
@media (min-width: 600px) {
    .kauth-shell {
        --kauth-gl: max(24px, calc((100% - 440px) / 2));
        --kauth-gr: max(24px, calc((100% - 440px) / 2));
    }
    .kauth-bar { padding-top: max(20px, env(safe-area-inset-top)); }
    .kauth-logo { height: 52px; }
    .kauth-intro { padding-top: 10px; padding-bottom: 24px; }
    .kauth-lede { display: block; margin: 6px 0 0; color: rgba(255, 255, 255, .88); font-size: 15px; }
    .kauth-main { padding-top: 28px; }
    .kauth-card { padding: 32px 32px 0; }
    .kauth-title { font-size: 28px; }
    .kauth-alt { margin: 28px -32px 0; padding: 12px 32px; }
    .kauth-marks li { flex-basis: 120px; }
}

/* ---------- Desktop: band panel left (brand, contact), card right (marks, copyright on the light canvas) ---------- */
@media (min-width: 960px) {
    .kauth-shell {
        --kauth-gl: clamp(32px, 4.5vw, 72px);
        --kauth-gr: clamp(32px, 4.5vw, 72px);
        grid-template-columns: clamp(400px, 42%, 680px) minmax(0, 1fr);
        grid-template-rows: 1fr auto;
        grid-template-areas: "brand main" "contact foot";
    }
    .kauth-shell::before {
        grid-area: 1 / 1 / 3 / 2;
        box-shadow: inset -3px 0 0 var(--kris-bar-accent);
        background:
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-100 -100 200 200' fill='none' stroke='%23fff'%3E%3Cg stroke-opacity='.11' stroke-width='.6'%3E%3Ccircle r='97'/%3E%3Ccircle r='79'/%3E%3Ccircle r='44'/%3E%3C/g%3E%3Ccircle r='88' stroke-opacity='.12' stroke-width='12' stroke-dasharray='.5 7.18'/%3E%3Cpath stroke-opacity='.07' stroke-width='.6' d='M0-97V97M-97 0H97M-68.6-68.6 68.6 68.6M-68.6 68.6 68.6-68.6'/%3E%3Cpath stroke-opacity='.14' stroke-width='.8' d='M0-92 9-9 92 0 9 9 0 92-9 9-92 0-9-9Z'/%3E%3Cpath stroke-opacity='.1' stroke-width='.6' transform='rotate(45)' d='M0-58 5-5 58 0 5 5 0 58-5 5-58 0-5-5Z'/%3E%3Cpath fill='%23fff' fill-opacity='.06' stroke='none' d='M0-92 9-9 0 0ZM92 0 9 9 0 0ZM0 92-9 9 0 0ZM-92 0-9-9 0 0Z'/%3E%3C/svg%3E") right -180px bottom -180px / 560px 560px no-repeat,
            linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 56px 56px,
            linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 56px 56px,
            var(--kris-band);
    }
    .kauth-brand { display: flex; flex-direction: column; }
    .kauth-bar { padding-top: 36px; }
    .kauth-logo { height: 60px; max-width: calc(100% - 112px); }
    .kauth-intro { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; max-width: 640px; padding-top: 48px; padding-bottom: 48px; }
    .kauth-eyebrow { font-size: 13px; }
    .kauth-eyebrow::before { content: ""; display: block; width: 40px; height: 3px; margin-bottom: 18px; border-radius: 2px; background: var(--kris-bar-accent); }
    .kauth-name { max-width: 16ch; margin-top: 10px; font-size: clamp(30px, 2.8vw, 40px); font-weight: 700; line-height: 1.12; letter-spacing: -.025em; text-wrap: balance; }
    .kauth-lede { max-width: 34ch; margin-top: 16px; font-size: 17px; }

    .kauth-main { justify-content: center; padding: 48px clamp(32px, 5vw, 96px) 24px; }
    .kauth-card { max-width: 420px; padding: 40px 36px 0; }
    .kauth-title { margin-bottom: 24px; font-size: 30px; }
    .kauth-alt { margin: 32px -36px 0; padding: 12px 36px; }

    .kauth-contact { padding: 0 var(--kauth-gr) 40px var(--kauth-gl); color: rgba(255, 255, 255, .82); text-align: left; }
    .kauth-contact__h {
        position: static !important;
        width: auto;
        height: auto;
        margin: 0 0 8px;
        overflow: visible;
        clip: auto;
        clip-path: none;
        white-space: normal;
        color: rgba(255, 255, 255, .82);
        font-size: 12px;
        font-weight: 700;
        line-height: 1.4;
        letter-spacing: .12em;
        text-transform: uppercase;
    }
    .kauth-contact__list { flex-direction: column; align-items: flex-start; }
    .kauth-contact__row,
    .kauth-contact__row:first-child { justify-content: flex-start; min-height: 32px; margin: 0; }
    .kauth-contact__row svg { color: var(--kauth-gold); }
    .kauth a.kauth-contact__row { color: #fff; text-decoration-color: rgba(255, 255, 255, .45); }
    .kauth a.kauth-contact__row:hover { color: #fff; text-decoration-color: #fff; }
    .kauth .kauth-contact :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

    .kauth-foot { align-self: end; padding: 0 32px 32px; }
    .kauth-marks { gap: 28px; }
    .kauth-copy { margin-top: 14px; }
}

/* Phones held sideways: the band shrinks to one row */
@media (min-width: 600px) and (max-width: 959px) and (max-height: 520px) {
    .kauth-bar { padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: 10px; }
    .kauth-logo { height: 40px; }
    .kauth-intro { display: none; }
    .kauth-main { padding-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .kauth *, .kauth *::before, .kauth *::after { transition: none !important; }
    .kauth-submit[aria-busy="true"] .kauth-spinner { display: none; }
    .page-loading-login::before { animation: none; background: #d9a21b; }
}

@media (forced-colors: active) {
    .kauth .kauth-home, .kauth-submit, .kauth-reveal { border: 1px solid ButtonText; }
    .kauth-alert, .kauth-caps:not(:empty), .kauth-card { border: 1px solid CanvasText; }
    .kauth-input.input-validation-error { border-width: 2px; }
}
