@font-face {
    font-family: "Source Sans Pro";
    src: local("Source Sans Pro"), url("../fonts/SourceSans3-Regular.woff2") format("woff2"), url("../fonts/SourceSans3-Regular.ttf") format("truetype");
    font-display: swap;
    font-style: normal;
    font-weight: 400;
}

@font-face {
    font-family: "Source Sans Pro";
    src: local("Source Sans Pro Semibold"), url("../fonts/SourceSans3-Semibold.woff2") format("woff2"), url("../fonts/SourceSans3-Semibold.ttf") format("truetype");
    font-display: swap;
    font-style: normal;
    font-weight: 600;
}

@font-face {
    font-family: "Source Sans Pro";
    src: local("Source Sans Pro Bold"), url("../fonts/SourceSans3-Bold.woff2") format("woff2"), url("../fonts/SourceSans3-Bold.ttf") format("truetype");
    font-display: swap;
    font-style: normal;
    font-weight: 700;
}

@font-face {
    font-family: "FontAwesome";
    src: url("../core/fa/fonts/fontawesome-webfont.woff2?v=4.7.0") format("woff2");
    font-display: swap;
    font-style: normal;
    font-weight: normal;
}

:root {
    --auth-red: #ed1c24;
    --auth-red-dark: #c91018;
    --auth-ink: #111111;
    --auth-copy: #353535;
    --auth-muted: #6f6f6f;
    --auth-line: #d8d8d8;
    --auth-soft: #f4f4f4;
    --auth-white: #ffffff;
    --auth-safe-top: env(safe-area-inset-top, 0px);
    --auth-safe-right: env(safe-area-inset-right, 0px);
    --auth-safe-bottom: env(safe-area-inset-bottom, 0px);
    --auth-safe-left: env(safe-area-inset-left, 0px);
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--auth-soft);
}

body.auth-page {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: max(20px, var(--auth-safe-top)) max(20px, var(--auth-safe-right)) max(20px, var(--auth-safe-bottom)) max(24px, var(--auth-safe-left));
    display: grid;
    place-items: center;
    overflow-x: hidden;
    background:
        linear-gradient(90deg, var(--auth-red) 0 4px, transparent 4px),
        var(--auth-soft);
    color: var(--auth-copy);
    font-family: "Source Sans Pro", "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: rgba(237, 28, 36, .14);
    touch-action: manipulation;
}

body.auth-page *,
body.auth-page *::before,
body.auth-page *::after {
    box-sizing: border-box;
}

.auth-shell {
    width: min(1040px, 100%);
    min-height: min(680px, calc(100dvh - 40px));
    display: grid;
    grid-template-columns: minmax(300px, .88fr) minmax(380px, 1.12fr);
    overflow: hidden;
    border-top: 4px solid var(--auth-red);
    border-radius: 3px;
    background: var(--auth-white);
    box-shadow: 0 24px 70px rgba(17, 17, 17, .16);
}

.auth-brand {
    position: relative;
    min-width: 0;
    padding: clamp(32px, 5vw, 64px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    background: var(--auth-ink);
    color: var(--auth-white);
    isolation: isolate;
}

.auth-brand::after {
    content: "EES";
    position: absolute;
    z-index: -1;
    right: -18px;
    bottom: -42px;
    color: rgba(255, 255, 255, .045);
    font-size: clamp(128px, 18vw, 230px);
    font-weight: 700;
    letter-spacing: -.08em;
    line-height: .8;
    pointer-events: none;
}

.auth-logo {
    width: 150px;
    min-height: 64px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-white);
}

.auth-logo img {
    display: block;
    width: 100%;
    height: auto;
}

.auth-brand-copy {
    position: relative;
    z-index: 1;
    max-width: 360px;
    margin: 56px 0 auto;
}

.auth-kicker {
    display: block;
    margin-bottom: 14px;
    color: var(--auth-red);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.auth-brand-copy h1 {
    margin: 0 0 18px;
    color: var(--auth-white);
    font-size: clamp(2.35rem, 5vw, 4.25rem);
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: .95;
}

.auth-brand-copy p {
    max-width: 30ch;
    margin: 0;
    color: #cfcfcf;
    font-size: 1.05rem;
    line-height: 1.55;
}

.auth-panel {
    min-width: 0;
    padding: clamp(34px, 6vw, 76px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--auth-white);
}

.auth-panel-header {
    margin-bottom: 30px;
}

.auth-mode-mark {
    width: 48px;
    height: 48px;
    margin-bottom: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(237, 28, 36, .1);
    color: var(--auth-red);
    font-size: 1.15rem;
}

.auth-panel-header h2 {
    margin: 0 0 10px;
    color: var(--auth-ink);
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.05;
}

.auth-panel-header p {
    max-width: 44ch;
    margin: 0;
    color: var(--auth-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.auth-form {
    width: 100%;
    margin: 0;
    text-align: left;
}

.auth-panel--setup {
    padding-block: clamp(30px, 5vw, 58px);
}

.auth-panel-header--setup {
    margin-bottom: 24px;
}

.auth-setup-form {
    max-width: 560px;
}

.auth-field {
    margin-bottom: 18px;
}

.auth-field label {
    display: block;
    margin: 0 0 7px;
    color: var(--auth-copy);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap > .fa {
    position: absolute;
    top: 50%;
    left: 18px;
    width: 20px;
    color: var(--auth-muted);
    font-size: 1rem;
    line-height: 1;
    text-align: center;
    transform: translateY(-50%);
    pointer-events: none;
}

.auth-page .auth-input {
    width: 100%;
    height: 56px;
    margin: 0;
    padding: 0 16px 0 52px;
    border: 1px solid #bdbdbd;
    border-radius: 0;
    background: var(--auth-white);
    color: var(--auth-ink);
    font: 600 1rem/1 "Source Sans Pro", "Segoe UI", Arial, sans-serif;
    box-shadow: none;
    appearance: none;
}

.auth-page .auth-input::placeholder {
    color: #969696;
    font-weight: 400;
}

.auth-page .auth-input:focus {
    border-color: var(--auth-red);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(237, 28, 36, .16);
}

.auth-page .auth-select {
    padding-right: 48px;
    cursor: pointer;
}

.auth-select-wrap::after {
    content: "\f078";
    position: absolute;
    top: 50%;
    right: 18px;
    color: var(--auth-muted);
    font-family: FontAwesome;
    font-size: .8rem;
    line-height: 1;
    transform: translateY(-50%);
    pointer-events: none;
}

.auth-submit {
    width: 100%;
    min-height: 56px;
    margin-top: 8px;
    padding: 12px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--auth-red) !important;
    border-radius: 0 !important;
    background: var(--auth-red) !important;
    color: var(--auth-white) !important;
    font: 700 1rem/1.15 "Source Sans Pro", "Segoe UI", Arial, sans-serif;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.auth-submit:hover,
.auth-submit:focus,
.auth-submit:active {
    border-color: var(--auth-red-dark) !important;
    background: var(--auth-red-dark) !important;
    color: var(--auth-white) !important;
}

.auth-submit:focus-visible {
    outline: 3px solid rgba(237, 28, 36, .32);
    outline-offset: 3px;
}

.auth-submit:disabled,
.auth-submit[aria-busy="true"] {
    opacity: .72;
    cursor: wait;
}

.auth-alert {
    width: 100%;
    margin: 0 0 20px;
    padding: 13px 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-left: 4px solid var(--auth-red);
    background: #fff1f2;
    color: #781016;
    font-size: .94rem;
    line-height: 1.4;
}

.auth-alert .fa {
    margin-top: 2px;
    flex: 0 0 auto;
    color: var(--auth-red);
}

.auth-switch {
    margin: 24px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--auth-line);
    text-align: center;
}

.auth-switch a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    color: var(--auth-ink);
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
}

.auth-switch a:hover,
.auth-switch a:focus {
    color: var(--auth-red);
    text-decoration: none;
}

.auth-switch a:focus-visible {
    outline: 2px solid var(--auth-red);
    outline-offset: 2px;
}

.auth-page .network-status:not(:empty) {
    position: fixed;
    z-index: 20;
    right: max(12px, var(--auth-safe-right));
    bottom: max(12px, var(--auth-safe-bottom));
    left: max(12px, var(--auth-safe-left));
    max-width: 720px;
    margin: 0 auto;
    padding: 12px 16px;
    border-left: 4px solid var(--auth-red);
    background: var(--auth-ink);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
    color: var(--auth-white);
    font-size: .9rem;
    font-weight: 600;
}

@media (max-width: 719.98px) {
    body.auth-page {
        place-items: start center;
        padding: max(12px, var(--auth-safe-top)) max(12px, var(--auth-safe-right)) max(12px, var(--auth-safe-bottom)) max(16px, var(--auth-safe-left));
    }

    .auth-shell {
        min-height: calc(100dvh - 24px);
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto 1fr;
    }

    .auth-brand {
        min-height: 128px;
        padding: 22px 24px;
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
        grid-template-rows: auto;
        gap: 16px 20px;
        align-items: center;
    }

    .auth-brand::after {
        right: -8px;
        bottom: -20px;
        font-size: 118px;
    }

    .auth-logo {
        width: 112px;
        min-height: 52px;
        padding: 8px 10px;
    }

    .auth-brand-copy {
        margin: 0;
    }

    .auth-kicker {
        margin-bottom: 6px;
        font-size: .68rem;
    }

    .auth-brand-copy h1 {
        margin: 0;
        font-size: clamp(1.6rem, 8vw, 2.25rem);
        line-height: 1;
    }

    .auth-brand-copy p {
        display: none;
    }

    .auth-panel {
        padding: 30px 24px 34px;
        justify-content: flex-start;
    }

    .auth-panel--setup {
        padding-top: 26px;
    }

    .auth-panel-header {
        margin-bottom: 24px;
    }

    .auth-mode-mark {
        width: 42px;
        height: 42px;
        margin-bottom: 16px;
    }
}

@media (max-width: 379.98px) {
    .auth-brand {
        grid-template-columns: 94px minmax(0, 1fr);
        padding-inline: 18px;
    }

    .auth-logo {
        width: 94px;
    }

    .auth-panel {
        padding-inline: 18px;
    }
}

@media (max-height: 620px) and (min-width: 720px) {
    body.auth-page {
        place-items: start center;
    }

    .auth-shell {
        min-height: 580px;
    }

    .auth-brand-copy {
        margin-top: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page *,
    .auth-page *::before,
    .auth-page *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
