:root {
    --login-sidebar: clamp(340px, 32vw, 430px);
    --login-ink: #153443;
    --login-muted: #6c8290;
    --login-line: #dce7ec;
    --login-teal: #1ca6a2;
    --login-cyan: #4db6e8;
}

body.portal-login-page {
    min-width: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--login-ink);
    background:
        radial-gradient(circle at 94% 2%, rgba(77, 182, 232, .12), transparent 30rem),
        linear-gradient(180deg, #f3f8fa 0%, #eef4f7 36rem, #f6f8fa 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.portal-login-page .topbar { display: none; }

.portal-login-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--login-sidebar) minmax(0, 1fr);
}

.portal-login-sidebar {
    position: fixed;
    z-index: 2;
    inset: 0 auto 0 0;
    width: var(--login-sidebar);
    min-height: 100vh;
    padding: 27px 26px 22px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: #e7f4f7;
    background:
        radial-gradient(circle at 8% 1%, rgba(77, 182, 232, .20), transparent 29%),
        radial-gradient(circle at 100% 82%, rgba(85, 214, 190, .12), transparent 34%),
        linear-gradient(165deg, #102f3e 0%, #092632 48%, #071d28 100%);
    border-right: 1px solid rgba(100, 210, 216, .15);
    box-shadow: 18px 0 45px rgba(8, 30, 42, .12);
}

.portal-login-sidebar::before {
    content: "";
    position: absolute;
    top: -92px;
    right: -82px;
    width: 205px;
    height: 205px;
    border: 1px solid rgba(112, 215, 219, .13);
    border-radius: 50%;
    box-shadow: 0 0 0 27px rgba(112, 215, 219, .025), 0 0 0 54px rgba(112, 215, 219, .016);
    pointer-events: none;
}

.portal-login-brand {
    position: relative;
    z-index: 1;
    padding: 0 2px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.portal-login-brand a { display: inline-flex; }
.portal-login-brand img {
    width: 168px;
    height: 58px;
    padding: 3px 0;
    display: block;
    object-fit: contain;
    object-position: left center;
    filter: drop-shadow(0 3px 7px rgba(0, 0, 0, .18));
}
.portal-login-brand span {
    color: #86a7b3;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .17em;
    text-transform: uppercase;
}

.portal-login-sidebar-content {
    position: relative;
    z-index: 1;
    margin: auto 0;
    padding: 30px 0 24px;
}
.portal-login-eyebrow {
    display: block;
    margin-bottom: 9px;
    color: #65d8dd;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.portal-login-sidebar h1 {
    max-width: 355px;
    margin: 0;
    color: #fff;
    font-size: clamp(30px, 3.1vw, 43px);
    line-height: 1.08;
    letter-spacing: -.04em;
}
.portal-login-sidebar-content > p {
    max-width: 350px;
    margin: 16px 0 0;
    color: #b8cdd5;
    font-size: 13px;
    line-height: 1.65;
}

.portal-login-features {
    margin-top: 29px;
    display: grid;
    gap: 8px;
}
.portal-login-features article {
    min-width: 0;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #d8e9ed;
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(255, 255, 255, .075);
    border-radius: 12px;
}
.portal-login-feature-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64d8ca;
    background: rgba(95, 214, 197, .10);
    border-radius: 10px;
}
.portal-login-feature-icon svg { width: 18px; height: 18px; stroke: currentColor; }
.portal-login-features strong { display: block; color: #f5fbfc; font-size: 11px; }
.portal-login-features small { display: block; margin-top: 3px; color: #86a7b3; font-size: 9px; }

.portal-login-sidebar-note {
    position: relative;
    z-index: 1;
    padding: 14px 15px;
    color: #a8c0c8;
    background: rgba(3, 21, 29, .28);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 14px;
}
.portal-login-sidebar-note span {
    display: block;
    margin-bottom: 5px;
    color: #58d0c0;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.portal-login-sidebar-note strong { display: block; margin-bottom: 4px; color: #f3fafb; font-size: 11px; }
.portal-login-sidebar-note p { margin: 0; font-size: 9px; line-height: 1.5; }
.portal-login-meta {
    position: relative;
    z-index: 1;
    margin: 13px 0 0;
    color: #75939e;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .08em;
    text-align: center;
    text-transform: uppercase;
}

.portal-login-content {
    position: relative;
    grid-column: 2;
    min-width: 0;
    min-height: 100vh;
    padding: 35px clamp(24px, 6vw, 82px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.portal-login-back {
    position: absolute;
    top: 28px;
    right: 34px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #537481;
    font-size: 10px;
    font-weight: 850;
    text-decoration: none;
}
.portal-login-back:hover { color: #176078; text-decoration: none; }
.portal-login-back svg { width: 16px; height: 16px; stroke: currentColor; }

.portal-login-card {
    position: relative;
    width: min(590px, 100%);
    padding: clamp(34px, 4.6vw, 52px);
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--login-line);
    border-radius: 20px;
    box-shadow: 0 22px 58px rgba(15, 44, 58, .10);
}
.portal-login-card::after {
    content: "";
    position: absolute;
    z-index: -1;
    right: -70px;
    bottom: -74px;
    width: 190px;
    height: 190px;
    background: radial-gradient(circle, rgba(77, 182, 232, .13), transparent 68%);
    pointer-events: none;
}
.portal-login-card-icon {
    width: 54px;
    height: 54px;
    margin-bottom: 21px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #176b7e;
    background: #e7f5f7;
    border-radius: 14px;
}
.portal-login-card-icon svg { width: 24px; height: 24px; stroke: currentColor; }
.portal-login-card-kicker {
    display: block;
    margin-bottom: 6px;
    color: #1a8d93;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .15em;
    text-transform: uppercase;
}
.portal-login-card h2 {
    margin: 0;
    color: #153b4b;
    font-size: clamp(29px, 3vw, 37px);
    line-height: 1.15;
    letter-spacing: -.025em;
}
.portal-login-card-copy { margin: 9px 0 28px; color: var(--login-muted); font-size: 13px; line-height: 1.55; }

.portal-login-alerts:empty { display: none; }
.portal-login-alert { margin-bottom: 16px; padding: 11px 13px; border-radius: 10px; font-size: 11px; line-height: 1.45; }
.portal-login-alert.error { color: #991b1b; background: #fee2e2; border: 1px solid #fecaca; }
.portal-login-alert.success { color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; }

.portal-login-form { display: grid; gap: 18px; }
.portal-login-field label {
    margin: 0 0 6px;
    color: #5d7480;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.portal-login-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.portal-login-label-row a {
    margin-bottom: 6px;
    color: #176078;
    font-size: 9px;
    font-weight: 800;
    text-decoration: none;
}
.portal-login-label-row a:hover { color: #0f4356; text-decoration: underline; }
.portal-login-input {
    position: relative;
    display: flex;
    align-items: center;
}
.portal-login-input svg {
    position: absolute;
    left: 13px;
    width: 17px;
    height: 17px;
    stroke: #77909b;
    pointer-events: none;
}
.portal-login-input input {
    width: 100%;
    min-height: 54px;
    padding: 12px 14px 12px 43px;
    color: #163b4a;
    background: #fbfdfe;
    border: 1px solid #d6e3e8;
    border-radius: 11px;
    font: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.portal-login-input input:focus {
    background: #fff;
    border-color: #58a9c7;
    box-shadow: 0 0 0 3px rgba(77, 182, 232, .10);
}
.portal-login-input:focus-within svg { stroke: #17778a; }

.portal-login-submit {
    width: 100%;
    min-height: 54px;
    margin-top: 3px;
    padding: 11px 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #073039;
    background: linear-gradient(135deg, #78ead4, #58c8dc);
    border: 0;
    border-radius: 11px;
    box-shadow: 0 10px 24px rgba(65, 196, 197, .20);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.portal-login-submit:hover { filter: saturate(1.07); box-shadow: 0 13px 28px rgba(65, 196, 197, .27); transform: translateY(-1px); }
.portal-login-submit:focus-visible { outline: 3px solid rgba(77, 182, 232, .24); outline-offset: 2px; }
.portal-login-submit svg { width: 17px; height: 17px; stroke: currentColor; }

.portal-login-divider {
    margin: 27px 0 19px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #8497a0;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}
.portal-login-divider::before,
.portal-login-divider::after { content: ""; flex: 1; height: 1px; background: var(--login-line); }
.portal-login-register {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #f5fafb;
    border: 1px solid #dcebee;
    border-radius: 13px;
}
.portal-login-register strong { display: block; color: #204653; font-size: 11px; }
.portal-login-register p { margin: 4px 0 0; color: #748b95; font-size: 10px; line-height: 1.45; }
.portal-login-register > a {
    min-height: 36px;
    padding: 9px 12px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #18546e;
    background: #fff;
    border: 1px solid #cfe3e9;
    border-radius: 9px;
    font-size: 9px;
    font-weight: 900;
    text-decoration: none;
}
.portal-login-register > a:hover { color: #fff; background: #18546e; border-color: #18546e; text-decoration: none; }
.portal-login-help { margin: 18px 0 0; color: #7d929b; font-size: 9px; text-align: center; }

@media (max-width: 900px) {
    :root { --login-sidebar: 100%; }
    .portal-login-layout { grid-template-columns: 1fr; }
    .portal-login-sidebar {
        position: relative;
        inset: auto;
        width: 100%;
        min-height: auto;
        padding: 22px 24px 27px;
        box-shadow: 0 16px 38px rgba(8, 30, 42, .13);
    }
    .portal-login-brand { padding-bottom: 13px; }
    .portal-login-brand img { width: 145px; height: 49px; }
    .portal-login-sidebar-content { margin: 0; padding: 25px 0 0; }
    .portal-login-sidebar h1 { max-width: 650px; font-size: clamp(28px, 6vw, 37px); }
    .portal-login-sidebar-content > p { max-width: 680px; }
    .portal-login-features,
    .portal-login-sidebar-note,
    .portal-login-meta { display: none; }
    .portal-login-content { grid-column: 1; min-height: auto; padding: 47px 22px 40px; }
    .portal-login-back { top: 18px; right: 22px; margin-top: 0; }
}

@media (max-width: 560px) {
    .portal-login-sidebar { padding: 17px 18px 22px; }
    .portal-login-brand { flex-direction: row; align-items: center; justify-content: space-between; }
    .portal-login-brand img { width: 128px; height: 43px; }
    .portal-login-sidebar h1 { font-size: 27px; }
    .portal-login-sidebar-content > p { margin-top: 11px; font-size: 11px; }
    .portal-login-content { padding: 44px 14px 28px; }
    .portal-login-back { right: 16px; }
    .portal-login-card { padding: 24px 19px; border-radius: 17px; }
    .portal-login-card-icon { width: 43px; height: 43px; margin-bottom: 14px; }
    .portal-login-card-copy { margin-bottom: 20px; }
    .portal-login-label-row { align-items: flex-start; flex-direction: column; gap: 0; }
    .portal-login-label-row a { order: 2; margin: 0 0 7px; }
    .portal-login-register { align-items: stretch; flex-direction: column; }
    .portal-login-register > a { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .portal-login-submit { transition: none; }
}
