:root {
    color-scheme: light;
    --ink: #142b40;
    --muted: #536677;
    --blue: #106b9f;
    --blue-hover: #0c557f;
    --line: #d4dee6;
    --page: #f2f5f7;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

.preview-page {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font: 16px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.preview-top, .preview-main, .preview-footer {
    width: min(1160px, calc(100% - 64px));
    margin-inline: auto;
}

.preview-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 84px;
}

.preview-brand { display: inline-flex; align-items: center; }
.preview-brand img { display: block; width: 151px; height: auto; }

.preview-site, .preview-footer a {
    color: var(--muted);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 550;
}

.preview-site { white-space: nowrap; }
.preview-site span { margin-inline-start: 4px; color: var(--blue); }
.preview-site:hover, .preview-footer a:hover { color: var(--blue); text-decoration: underline; }

.preview-main {
    display: grid;
    grid-template-columns: 1.08fr 1fr;
    align-self: center;
    overflow: hidden;
    margin-block: 24px;
    min-height: 574px;
    border: 1px solid #dbe4eb;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 16px 52px #1e3f5714;
}

.preview-cover {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: flex-end;
    padding: clamp(32px, 5vw, 66px);
    background-color: #0c2e44;
    background-image:
        linear-gradient(180deg, #0d354f38 2%, #0b2c4460 36%, #071e30e8 76%, #071e30 100%),
        url("/img/login_background.jpg");
    background-size: cover;
    background-position: center, 58% 42%;
    color: #fff;
}

.preview-cover::before {
    position: absolute;
    z-index: -1;
    inset: 22px;
    border: 1px solid #e2f4ff42;
    border-radius: 12px;
    content: "";
    pointer-events: none;
}

.preview-cover-copy { max-width: 390px; }
.preview-cover h2 {
    margin: 0;
    font-size: clamp(2.9rem, 5.05vw, 4.85rem);
    line-height: 1.01;
    letter-spacing: -.06em;
    font-weight: 690;
}

.preview-cover p {
    max-width: 30ch;
    margin: 16px 0 0;
    color: #e1edf4;
    font-size: clamp(1rem, 1.4vw, 1.125rem);
}

.preview-content {
    display: grid;
    align-content: center;
    padding: clamp(30px, 5vw, 65px) clamp(36px, 6vw, 78px);
}

.preview-form-wrap {
    width: min(100%, 410px);
    margin-inline: auto;
    container-type: inline-size;
}

.preview-content h1 {
    margin: 0 0 30px;
    font-size: clamp(2rem, 3.4vw, 3rem);
    letter-spacing: -.05em;
    line-height: 1.1;
    font-weight: 720;
}

.preview-steps { display: grid; }
.preview-steps > * {
    grid-area: 1 / 1;
    min-inline-size: 0;
    align-self: start;
}

/* The inactive step still measures the shared grid cell. */
.preview-steps > [hidden] { display: block !important; }
.preview-steps > [hidden], [data-step="verification"] .preview-credentials { visibility: hidden; }

.preview-field { margin: 0 0 17px; }
.preview-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--ink);
    font-size: .9rem;
    font-weight: 620;
}

.preview-field input {
    display: block;
    width: 100%;
    min-height: 51px;
    padding: 10px 14px;
    border: 1px solid #bbcbd7;
    border-radius: 8px;
    background: #fbfcfd;
    color: var(--ink);
    font: inherit;
}

.preview-field input:disabled { background: #f5f7f9; }
.preview-field input:focus { border-color: var(--blue); background: #fff; }

.preview-password-field { position: relative; }
.preview-password-field input { padding-inline-end: 88px; }
#preview-password-toggle {
    position: absolute;
    top: 7px;
    right: 7px;
    bottom: 7px;
    padding-inline: 9px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--blue);
    font-family: inherit;
    font-size: .8rem;
    font-weight: 620;
    line-height: 1;
    cursor: pointer;
}

#preview-password-toggle:not(:disabled):hover { background: #eaf3fa; }
#preview-password-toggle:disabled { color: var(--muted); cursor: default; }

.preview-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 9px 15px;
    margin: 4px 0 24px;
    font-size: .875rem;
}

.preview-remember { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.preview-remember input { width: 17px; height: 17px; margin: 0; accent-color: var(--blue); }
.preview-options a, .preview-access a, .preview-text-button {
    color: var(--blue);
    text-decoration: none;
    font-weight: 650;
}

.preview-options a:hover, .preview-access a:hover, .preview-text-button:hover { text-decoration: underline; }

.preview-submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 53px;
    padding: 10px 17px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    font: inherit;
    font-weight: 680;
    text-decoration: none;
    cursor: pointer;
}

.preview-submit:not(:disabled):hover { background: var(--blue-hover); }
.preview-submit:disabled { background: #527e98; cursor: default; }
.preview-submit [aria-hidden="true"] { font-size: 1.24rem; line-height: 1; }
.preview-submit [data-submit-label] { min-inline-size: 0; white-space: nowrap; }
.preview-arrow { flex: none; }
.preview-access {
    margin: 23px 0 0;
    padding-top: 19px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .875rem;
}

.preview-access a { margin-inline-start: 3px; }
.preview-feedback, .preview-session-note {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 7px;
    background: #edf5fb;
    color: #254d68;
    font-size: .875rem;
}

.preview-status {
    min-block-size: calc(2.7em + 8px);
    margin-block-start: 8px;
    font-size: .875rem;
}

.preview-status .preview-feedback {
    margin: 0;
    padding: 4px 8px;
    font-size: inherit;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

#preview-login:has(.preview-status) + .preview-access { margin-top: 0; padding-top: 14px; }
.preview-feedback[data-state="error"] { background: #fff0ef; color: #902720; }
.preview-session-note { margin: 12px 0 0; }
.preview-factor {
    margin: 0 0 18px;
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f1f7fb;
}

.preview-factor .preview-field { margin-bottom: 7px; }
.preview-factor p { margin: 0 0 9px; color: var(--muted); font-size: .875rem; }
#preview-code { max-width: 185px; letter-spacing: .16em; }
.preview-text-button {
    padding: 5px 0;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: .83rem;
    cursor: pointer;
}

.preview-page :focus-visible { outline: 2px solid #1378b4; outline-offset: 3px; }

.preview-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px 23px;
    padding-block: 18px 27px;
}

@media (max-width: 900px) {
    .preview-top, .preview-main, .preview-footer { width: calc(100% - 40px); }
    .preview-content { padding: 35px; }
    .preview-cover { padding: 40px; }
}

@media (max-width: 680px) {
    .preview-page { grid-template-rows: auto auto 1fr; }
    .preview-top, .preview-main, .preview-footer { width: calc(100% - 28px); }
    .preview-top { min-height: 65px; }
    .preview-brand img { width: 123px; }
    .preview-site { font-size: .78rem; }
    .preview-main { grid-template-columns: 1fr; min-height: 0; margin-block: 5px 12px; border-radius: 15px; }
    .preview-cover {
        min-height: 150px;
        padding: 23px;
        background-position: center, 57% 48%;
        background-image:
            linear-gradient(90deg, #0a263bdd 0%, #0a263ba8 56%, #0a263b52 100%),
            url("/img/login_background.jpg");
    }
    .preview-cover::before { inset: 9px; border-radius: 7px; }
    .preview-cover h2 { font-size: clamp(1.7rem, 6.6vw, 2.35rem); letter-spacing: -.045em; }
    .preview-cover h2 br { display: none; }
    .preview-cover p { margin-top: 7px; font-size: .9rem; }
    .preview-content { padding: 27px 21px 24px; }
    .preview-content h1 { margin-bottom: 21px; }
    .preview-options { margin-bottom: 17px; }
    .preview-access { margin-top: 18px; padding-top: 14px; }
    .preview-footer {
        justify-content: center;
        align-content: start;
        padding-block: 3px 18px;
        /* Leave room for the reCAPTCHA badge along the viewport edge. */
        padding-inline-end: 68px;
    }
}

@container (max-width: 310px) {
    .preview-status { min-block-size: calc(4.05em + 8px); }
    .preview-submit { padding-inline: 12px; gap: 8px; font-size: .875rem; }
}
