:root {
    color-scheme: light;
    --pb-navy: #18193e;
    --pb-navy-deep: #0f102d;
    --pb-navy-soft: #2a2d59;
    --pb-green: #00dfa2;
    --pb-green-soft: #c9faec;
    --pb-paper: #fbfbfa;
    --pb-surface: #f1f2f4;
    --pb-line: #d9dce4;
    --pb-text-soft: #65697b;
    --pb-white: #ffffff;
    --pb-error: #a93434;
    --pb-ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    background: var(--pb-paper);
    color: var(--pb-navy);
    font-family: "Manrope", "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }

.portal-login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(560px, 1.15fr) minmax(430px, .85fr);
    overflow: hidden;
}

.portal-visual {
    position: relative;
    isolation: isolate;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 8%, rgba(0,223,162,.13), transparent 25%),
        linear-gradient(145deg, #11122f 0%, var(--pb-navy) 62%, #20224b 100%);
    color: var(--pb-white);
    padding: clamp(32px, 3.8vw, 58px) clamp(36px, 5vw, 76px);
}

.portal-visual::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.16) .7px, transparent .7px);
    background-size: 25px 25px;
    opacity: .24;
    -webkit-mask-image: linear-gradient(to bottom right, #000 0%, transparent 67%);
    mask-image: linear-gradient(to bottom right, #000 0%, transparent 67%);
}

.portal-visual::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: min(42vw, 620px);
    aspect-ratio: 1;
    right: -25%;
    bottom: -37%;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 50%;
    box-shadow:
        0 0 0 80px rgba(255,255,255,.025),
        0 0 0 160px rgba(255,255,255,.018);
}

.visual-header,
.visual-footer,
.visual-content { position: relative; z-index: 2; }

.visual-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand-logo-light {
    display: block;
    width: clamp(198px, 15vw, 246px);
    height: auto;
}

.visual-content {
    width: min(100%, 760px);
    margin-block: auto;
    padding: clamp(42px, 6vh, 82px) 0 clamp(34px, 5vh, 64px);
}

.visual-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--pb-green);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.visual-eyebrow::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 6px rgba(0,223,162,.12);
}

.visual-title {
    max-width: 710px;
    margin: 0;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: clamp(43px, 4.7vw, 72px);
    font-weight: 500;
    letter-spacing: -.048em;
    line-height: .98;
    text-wrap: balance;
}

.visual-title em {
    color: var(--pb-green);
    font-style: normal;
}

.visual-description {
    max-width: 590px;
    margin: 22px 0 0;
    color: rgba(255,255,255,.66);
    font-size: clamp(14px, 1.15vw, 17px);
    line-height: 1.7;
}

.workflow-board {
    position: relative;
    width: min(100%, 690px);
    margin-top: clamp(34px, 5vh, 52px);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 18px;
    background: rgba(251,251,250,.98);
    color: var(--pb-navy);
    box-shadow: 0 28px 70px rgba(4,5,22,.35);
    transform: perspective(1200px) rotateX(1deg) rotateY(-1deg);
    transform-origin: left center;
}

.board-head {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--pb-line);
    background: var(--pb-white);
    padding: 0 17px;
}

.window-dots { display: flex; gap: 6px; }

.window-dots i {
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d6d8df;
}

.window-dots i:first-child { background: var(--pb-green); }

.board-title {
    overflow: hidden;
    color: #7b7f8f;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.board-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #168366;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.board-live::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pb-green);
    box-shadow: 0 0 0 4px rgba(0,223,162,.13);
}

.workflow-flow {
    display: grid;
    grid-template-columns: 1fr 34px 1fr 34px 1fr;
    align-items: center;
    padding: 22px 20px 19px;
}

.workflow-step {
    min-width: 0;
    border: 1px solid var(--pb-line);
    border-radius: 12px;
    background: var(--pb-white);
    padding: 15px;
    transition: border-color .42s var(--pb-ease), box-shadow .42s var(--pb-ease), transform .42s var(--pb-ease), background .42s ease;
}

.workflow-step.is-active {
    border-color: rgba(0,223,162,.9);
    background: #f7fffc;
    box-shadow: 0 12px 28px rgba(24,25,62,.09), inset 0 0 0 1px rgba(0,223,162,.15);
    transform: translateY(-4px);
}

.step-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.step-icon {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 9px;
    background: #eff0f4;
    color: var(--pb-navy);
    transition: background .42s ease;
}

.workflow-step.is-active .step-icon { background: var(--pb-green-soft); }
.step-icon svg { width: 16px; height: 16px; }

.step-number {
    color: #a4a7b2;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 17px;
    font-weight: 600;
}

.workflow-step h3 {
    overflow: hidden;
    margin: 13px 0 4px;
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workflow-step p {
    overflow: hidden;
    margin: 0;
    color: #858895;
    font-size: 9px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workflow-arrow {
    position: relative;
    height: 1px;
    background: #d1d4dc;
}

.workflow-arrow::after {
    content: "";
    position: absolute;
    top: -3px;
    right: 0;
    width: 7px;
    height: 7px;
    border-top: 1px solid #aaadba;
    border-right: 1px solid #aaadba;
    transform: rotate(45deg);
}

.board-foot {
    display: flex;
    min-height: 43px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--pb-line);
    background: #f5f6f7;
    padding: 0 18px;
}

.board-status {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
    color: #5f6375;
    font-size: 10px;
    font-weight: 700;
}

.board-status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--pb-green);
}

.board-status-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-system {
    color: #9497a4;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.visual-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-top: 1px solid rgba(255,255,255,.13);
    padding-top: 18px;
    color: rgba(255,255,255,.48);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .02em;
}

.visual-footer span { display: inline-flex; align-items: center; gap: 7px; }
.visual-footer svg { width: 14px; height: 14px; color: var(--pb-green); }

.login-area {
    position: relative;
    display: grid;
    min-height: 100vh;
    grid-template-rows: auto 1fr auto;
    overflow-y: auto;
    background: #eef0f3;
    padding: clamp(26px, 3vw, 44px) clamp(24px, 3.2vw, 48px) 22px;
}

.login-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.secure-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--pb-text-soft);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.secure-label span {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border: 1px solid var(--pb-line);
    border-radius: 50%;
    background: var(--pb-white);
    color: var(--pb-navy);
}

.secure-label svg { width: 13px; height: 13px; }
.mobile-logo { display: none; }

.home-link {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--pb-line);
    border-radius: 9px;
    background: var(--pb-white);
    color: var(--pb-navy);
    padding: 0 13px;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(24,25,62,.035);
    transition: border-color .2s ease, background .2s ease, transform .2s var(--pb-ease);
}

.home-link:hover {
    border-color: var(--pb-navy);
    background: var(--pb-navy);
    color: var(--pb-white);
    transform: translateY(-1px);
}

.home-link svg { width: 15px; height: 15px; }
.mobile-home-link { display: none; }

.auth-shell {
    width: min(100%, 500px);
    margin: auto;
    border: 1px solid rgba(207,211,220,.9);
    border-radius: 18px;
    background: rgba(255,255,255,.98);
    padding: clamp(34px, 5vh, 44px) clamp(32px, 3.3vw, 44px);
    box-shadow: 0 24px 65px rgba(24,25,62,.09), 0 2px 8px rgba(24,25,62,.035);
    animation: auth-in .8s var(--pb-ease) both;
}

.portal-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--pb-line);
    border-radius: 999px;
    background: var(--pb-white);
    color: var(--pb-navy);
    padding: 7px 11px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.portal-tag::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--pb-green);
}

.auth-title {
    margin: 0;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: clamp(40px, 4vw, 52px);
    font-weight: 500;
    letter-spacing: -.042em;
    line-height: 1.02;
}

.auth-description {
    margin: 14px 0 34px;
    color: var(--pb-text-soft);
    font-size: 13px;
    line-height: 1.7;
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 22px;
    border: 1px solid #efcccc;
    border-left: 3px solid var(--pb-error);
    border-radius: 8px;
    background: #fff6f6;
    color: #842b2b;
    padding: 12px 13px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
}

.login-alert svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }

.form-field { margin-bottom: 19px; }

.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.field-label {
    color: var(--pb-navy);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .025em;
}

.forgot-link {
    color: var(--pb-text-soft);
    font-size: 12px;
    font-weight: 750;
    text-decoration: none;
    transition: color .2s ease;
}

.forgot-link:hover { color: var(--pb-navy); text-decoration: underline; text-underline-offset: 3px; }

.control-wrap { position: relative; }

.control-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 16px;
    width: 18px;
    height: 18px;
    color: #898d9c;
    transform: translateY(-50%);
    pointer-events: none;
    transition: color .2s ease;
}

.form-control {
    width: 100%;
    height: 56px;
    outline: none;
    border: 1px solid var(--pb-line);
    border-radius: 10px;
    background: var(--pb-white);
    color: var(--pb-navy);
    padding: 0 48px;
    font-size: 13px;
    font-weight: 650;
    box-shadow: 0 1px 2px rgba(24,25,62,.02);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.form-control::placeholder { color: #a0a3ae; font-weight: 500; }

.form-control:hover { border-color: #b8bbc7; }

.form-control:focus {
    border-color: var(--pb-navy);
    background: var(--pb-white);
    box-shadow: 0 0 0 4px rgba(24,25,62,.075), 0 8px 20px rgba(24,25,62,.045);
}

.control-wrap:focus-within .control-icon { color: var(--pb-navy); }

.password-toggle {
    position: absolute;
    z-index: 2;
    top: 50%;
    right: 10px;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    outline: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #7d8191;
    padding: 0;
    transform: translateY(-50%);
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.password-toggle:hover,
.password-toggle:focus-visible { background: var(--pb-surface); color: var(--pb-navy); }
.password-toggle svg { width: 17px; height: 17px; }
.password-toggle .is-hidden { display: none; }

.caps-warning {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    color: #966b1f;
    font-size: 10px;
    font-weight: 750;
}

.caps-warning.is-visible { display: flex; }
.caps-warning svg { width: 13px; height: 13px; }

.form-security {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 4px 0 25px;
    color: #7c8090;
    font-size: 11px;
    font-weight: 650;
}

.form-security svg { width: 13px; height: 13px; color: #168366; }

.login-button {
    position: relative;
    display: flex;
    width: 100%;
    height: 57px;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    outline: none;
    border: 1px solid var(--pb-navy);
    border-radius: 10px;
    background: var(--pb-navy);
    color: var(--pb-white);
    padding: 0 14px 0 20px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .015em;
    box-shadow: 0 8px 24px rgba(24,25,62,.16);
    cursor: pointer;
    transition: background .25s ease, transform .25s var(--pb-ease), box-shadow .25s ease;
}

.login-button::before {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    right: -100px;
    border-radius: 50%;
    background: var(--pb-green);
    opacity: .08;
    transition: transform .45s var(--pb-ease), opacity .3s ease;
}

.login-button:hover {
    background: var(--pb-navy-deep);
    transform: translateY(-2px);
    box-shadow: 0 13px 30px rgba(24,25,62,.22);
}

.login-button:hover::before { opacity: .15; transform: scale(1.3); }
.login-button:active { transform: translateY(0); }
.login-button:focus-visible { box-shadow: 0 0 0 4px rgba(0,223,162,.3), 0 10px 26px rgba(24,25,62,.18); }
.login-button:disabled { cursor: wait; opacity: .84; transform: none; }

.button-arrow {
    position: relative;
    z-index: 1;
    display: grid;
    width: 31px;
    height: 31px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 8px;
    background: var(--pb-green);
    color: var(--pb-navy-deep);
    transition: transform .3s var(--pb-ease);
}

.button-arrow svg { width: 15px; height: 15px; }
.login-button:hover .button-arrow { transform: translateX(2px); }

.button-loader {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(24,25,62,.3);
    border-top-color: var(--pb-navy);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.login-button.is-loading .button-arrow svg { display: none; }
.login-button.is-loading .button-loader { display: block; }

.access-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 20px;
}

.access-feature {
    min-width: 0;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    background: rgba(255,255,255,.62);
    padding: 9px 8px;
    color: #7c8090;
    font-size: 10px;
    font-weight: 750;
    text-align: center;
    white-space: nowrap;
}

.login-footer {
    color: #9194a0;
    font-size: 11px;
    line-height: 1.6;
    text-align: center;
}

.login-footer a {
    color: var(--pb-navy);
    font-weight: 800;
    text-decoration: none;
}

.login-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

a:focus-visible {
    outline: 3px solid rgba(0,223,162,.42);
    outline-offset: 3px;
    border-radius: 3px;
}

@keyframes auth-in {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes visual-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin { to { transform: rotate(360deg); } }

.visual-eyebrow,
.visual-title,
.visual-description,
.workflow-board { animation: visual-in .72s var(--pb-ease) both; }
.visual-title { animation-delay: .08s; }
.visual-description { animation-delay: .16s; }
.workflow-board { animation-delay: .24s; }

@media (max-height: 780px) and (min-width: 961px) {
    .portal-visual { padding-block: 30px; }
    .visual-content { padding-block: 35px 28px; }
    .visual-title { font-size: clamp(40px, 4.4vw, 59px); }
    .visual-description { margin-top: 15px; }
    .workflow-board { margin-top: 28px; }
    .workflow-flow { padding-block: 17px 15px; }
    .workflow-step { padding: 12px; }
    .login-area { padding-block: 22px 16px; }
    .auth-shell { padding-block: 30px; }
}

@media (max-width: 1100px) {
    .portal-login { grid-template-columns: minmax(480px, 1fr) minmax(400px, .9fr); }
    .workflow-flow { grid-template-columns: 1fr 22px 1fr 22px 1fr; padding-inline: 15px; }
    .workflow-step { padding: 12px 10px; }
    .login-area { padding-inline: 24px; }
}

@media (max-width: 960px) {
    .portal-login { display: block; overflow: visible; }

    .portal-visual {
        min-height: 235px;
        padding: 28px 38px 34px;
    }

    .brand-logo-light { width: 190px; }
    .mobile-home-link {
        display: inline-flex;
        border-color: rgba(255,255,255,.23);
        background: rgba(255,255,255,.07);
        color: var(--pb-white);
        box-shadow: none;
    }
    .mobile-home-link:hover {
        border-color: var(--pb-green);
        background: var(--pb-green);
        color: var(--pb-navy-deep);
    }
    .visual-content { margin: 0; padding: 40px 0 0; }
    .visual-eyebrow { display: none; }
    .visual-title { max-width: 580px; font-size: clamp(34px, 6vw, 50px); line-height: 1.03; }
    .visual-description { max-width: 590px; margin-top: 13px; font-size: 13px; }
    .workflow-board, .visual-footer { display: none; }

    .login-area {
        min-height: calc(100svh - 235px);
        overflow: visible;
        background: var(--pb-white);
        padding: 30px 38px 22px;
    }

    .login-topbar { display: none; }
    .auth-shell {
        width: min(100%, 470px);
        border: 0;
        background: transparent;
        padding: 34px 0 42px;
        box-shadow: none;
    }
}

@media (max-width: 600px) {
    .portal-visual { min-height: 142px; justify-content: center; padding: 25px 22px; }
    .brand-logo-light { width: 174px; }
    .mobile-home-link { min-height: 35px; padding-inline: 10px; font-size: 10px; }
    .visual-content { display: none; }

    .login-area {
        min-height: calc(100svh - 142px);
        padding: 27px 21px 18px;
    }

    .auth-shell { padding: 18px 0 34px; }
    .portal-tag { margin-bottom: 15px; }
    .auth-title { font-size: 39px; }
    .auth-description { margin-bottom: 27px; }
    .form-control { height: 54px; }
    .login-button { height: 55px; }
    .access-features { display: none; }
}

@media (max-width: 360px) {
    .portal-visual { min-height: 124px; }
    .login-area { min-height: calc(100svh - 124px); padding-inline: 17px; }
    .auth-title { font-size: 35px; }
    .auth-description { font-size: 12px; }
}

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