:root {
    --kibco-navy: #153d78;
    --kibco-blue: #0c8fc3;
    --kibco-gold: #c99d1b;
    --kibco-ink: #1d2c43;
    --kibco-muted: #68778e;
    --kibco-border: #d7e0eb;
    --kibco-surface: #f7f9fc;
}

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

html,
body.auth-portal {
    min-height: 100%;
    margin: 0;
}

body.auth-portal {
    background: #edf2f8;
    color: var(--kibco-ink);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(400px, .92fr);
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-branding {
    position: relative;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    isolation: isolate;
    background: #123d72;
}

.auth-branding-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.auth-panel {
    display: flex;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 5vw, 70px);
    background:
        radial-gradient(circle at 100% 0, rgba(210, 226, 242, .52), transparent 34%),
        #fbfcfe;
}

.auth-content {
    width: 100%;
    max-width: 460px;
    margin: auto;
    animation: auth-enter .36s ease-out both;
}

.auth-logo {
    display: flex;
    width: min(100%, 340px);
    height: 105px;
    align-items: center;
    justify-content: flex-start;
    margin: 0 auto 22px;
    text-decoration: none;
}

.auth-logo img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: left center;
}

.auth-heading {
    margin-bottom: 27px;
    text-align: left;
}

.auth-heading h1 {
    margin: 0 0 7px;
    color: #172a46;
    font-size: clamp(25px, 2.5vw, 32px);
    font-weight: 750;
    letter-spacing: -.035em;
    line-height: 1.2;
}

.auth-heading p {
    margin: 0;
    color: var(--kibco-muted);
    font-size: 14px;
    line-height: 1.55;
}

.auth-form {
    width: 100%;
}

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

.auth-field > label {
    display: block;
    margin: 0 0 7px 2px;
    color: #2d3e56;
    font-size: 12px;
    font-weight: 700;
}

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

.auth-input-icon {
    position: absolute;
    top: 50%;
    left: 17px;
    z-index: 1;
    color: #52729a;
    font-size: 15px;
    pointer-events: none;
    transform: translateY(-50%);
}

.auth-input {
    display: block;
    width: 100%;
    min-height: 53px;
    padding: 0 50px 0 48px;
    border: 1px solid var(--kibco-border);
    border-radius: 11px;
    outline: none;
    background: #fff;
    color: var(--kibco-ink);
    font: inherit;
    font-size: 14px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-input::placeholder {
    color: #8a98ab;
    opacity: 1;
}

.auth-input:focus {
    border-color: var(--kibco-blue);
    box-shadow: 0 0 0 4px rgba(12, 143, 195, .13);
}

.auth-input.is-invalid {
    border-color: #c63843;
}

.auth-input-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #647a95;
    cursor: pointer;
    font: inherit;
    transform: translateY(-50%);
}

.auth-input-toggle:hover,
.auth-input-toggle:focus {
    background: #eef4fa;
    color: var(--kibco-navy);
}

.auth-input-toggle:focus,
.auth-secondary-action:focus,
.auth-link:focus {
    outline: 3px solid rgba(12, 143, 195, .22);
    outline-offset: 2px;
}

.auth-field-error {
    display: block;
    margin: 6px 2px 0;
    color: #b42332;
    font-size: 12px;
}

.auth-options {
    display: flex;
    min-height: 34px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 1px 0 20px;
}

.auth-privacy-note {
    color: var(--kibco-muted);
    font-size: 11px;
}

.auth-privacy-note i {
    margin-right: 5px;
    color: #348a6d;
}

.auth-link,
.auth-return-link a {
    color: var(--kibco-navy);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.auth-link:hover,
.auth-return-link a:hover {
    color: var(--kibco-blue);
    text-decoration: underline;
}

.auth-submit {
    display: flex;
    width: 100%;
    min-height: 53px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(105deg, #153d78, #087fb1);
    box-shadow: 0 9px 20px rgba(21, 61, 120, .16);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    transition: box-shadow .18s ease, transform .18s ease, opacity .18s ease;
}

.auth-submit:hover {
    box-shadow: 0 12px 24px rgba(21, 61, 120, .23);
    transform: translateY(-1px);
}

.auth-submit:disabled {
    cursor: wait;
    opacity: .78;
    transform: none;
}

.auth-submit:focus {
    outline: 3px solid rgba(12, 143, 195, .28);
    outline-offset: 3px;
}

.auth-error,
.auth-success {
    margin: 0 0 16px;
    padding: 11px 13px;
    border: 1px solid;
    border-radius: 9px;
    font-size: 12px;
    line-height: 1.5;
}

.auth-error {
    border-color: #f0c4c6;
    background: #fff2f2;
    color: #9c2731;
}

.auth-success {
    border-color: #bfdfcd;
    background: #effaf3;
    color: #256242;
}

.auth-security {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 23px;
    padding: 12px 13px;
    border: 1px solid #dce7f1;
    border-radius: 11px;
    background: #f4f8fc;
    color: #52647a;
    font-size: 11px;
    line-height: 1.45;
}

.auth-security-icon {
    display: inline-flex;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #e1f3eb;
    color: #278459;
}

.auth-footer {
    margin-top: 20px;
    color: #8490a0;
    font-size: 10px;
    text-align: center;
}

.auth-code-instructions {
    margin: -4px 0 21px;
    color: var(--kibco-muted);
    font-size: 13px;
    line-height: 1.6;
}

.auth-code-instructions strong {
    color: var(--kibco-navy);
    overflow-wrap: anywhere;
}

.auth-code-input {
    padding-left: 46px;
    font-size: 20px;
    font-weight: 750;
    letter-spacing: .35em;
    text-align: center;
}

.auth-resend-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 12px;
    margin-top: 12px;
}

.auth-logout-form {
    margin-top: 5px;
}

.auth-secondary-action {
    display: inline-flex;
    min-height: 35px;
    align-items: center;
    gap: 7px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: var(--kibco-navy);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

.auth-secondary-action:hover {
    color: var(--kibco-blue);
    text-decoration: underline;
}

.auth-secondary-action:disabled {
    color: #8995a5;
    cursor: not-allowed;
    text-decoration: none;
}

.auth-resend-countdown {
    color: var(--kibco-muted);
    font-size: 11px;
}

.auth-return-link {
    margin: 17px 0 0;
    text-align: center;
}

.auth-return-link a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

@keyframes auth-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr) minmax(350px, .95fr);
    }

}

@media (max-width: 700px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-branding {
        height: auto;
        min-height: 0;
        aspect-ratio: 1 / 1;
    }

    .auth-panel {
        min-height: auto;
        padding: 25px 22px 30px;
    }

    .auth-content {
        max-width: 460px;
    }

    .auth-logo {
        width: min(100%, 300px);
        height: 83px;
        justify-content: center;
        margin-bottom: 16px;
    }

    .auth-logo img {
        object-position: center;
    }

    .auth-heading {
        margin-bottom: 22px;
    }

    .auth-heading h1 {
        font-size: 26px;
    }
}

@media (max-width: 360px) {
    .auth-panel {
        padding-right: 17px;
        padding-left: 17px;
    }

    .auth-options {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 7px;
    }
}

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