/* Only the anonymous entry screen and registration opt into this palette. */
body.bip-public {
    --bs-body-color: #e5e5e5;
    --bs-secondary-color: #929292;
    --bs-danger: #ff747b;
    --bs-danger-rgb: 255, 116, 123;
    --bs-form-invalid-color: #ff747b;
    --bs-form-invalid-border-color: #ff747b;
    --bs-border-radius: 4px;
    --bs-border-radius-lg: 6px;
    background: #08090b;
    color: #e5e5e5;
    color-scheme: dark;
    overflow-wrap: anywhere;
}
.bip-public .bip-checkpoint {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 24px 16px max(24px, env(safe-area-inset-bottom));
    /* Keep the portrait's heading intact on wide screens; dark side margins blend in. */
    background-image: linear-gradient(0deg, #08090b 0%, transparent 28%), url('/images/landing/bip-checkpoint.webp');
    background-size: 100% 100%, auto 100%;
    background-position: center, center top;
    background-repeat: no-repeat;
}
.bip-public .bip-landing-actions {
    display: flex;
    gap: 16px;
    width: min(100%, 560px);
}
.bip-public .bip-landing-actions .btn { flex: 1; }
.bip-public .btn {
    border-radius: 4px;
    min-height: 48px;
    padding: 12px 16px;
    font-weight: 500;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.bip-public .bip-entry, .bip-public .btn-outline-success {
    --bs-btn-color: #ff747b;
    --bs-btn-bg: rgba(20, 22, 25, .88);
    --bs-btn-border-color: #c52b32;
    --bs-btn-hover-color: #e5e5e5;
    --bs-btn-hover-bg: #30181b;
    --bs-btn-hover-border-color: #e14a51;
    --bs-btn-active-color: #e5e5e5;
    --bs-btn-active-bg: #481c20;
    --bs-btn-active-border-color: #e14a51;
}
.bip-public .bip-register {
    --bs-btn-color: #e5e5e5;
    --bs-btn-bg: rgba(20, 22, 25, .88);
    --bs-btn-border-color: #36383c;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #1c1e22;
    --bs-btn-hover-border-color: #929292;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #36383c;
    --bs-btn-active-border-color: #929292;
}
.bip-public .btn-success {
    --bs-btn-color: #fff;
    --bs-btn-bg: #c52b32;
    --bs-btn-border-color: #c52b32;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #d5363e;
    --bs-btn-hover-border-color: #e14a51;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #a32128;
    --bs-btn-active-border-color: #c52b32;
    --bs-btn-disabled-color: #929292;
    --bs-btn-disabled-bg: #442024;
    --bs-btn-disabled-border-color: #633036;
}
.bip-public .btn:disabled, .bip-public .btn.disabled { opacity: .55; cursor: not-allowed; }
.bip-public .btn:hover { box-shadow: 0 0 16px rgba(197, 43, 50, .12); }
.bip-public :is(a, button, input):focus-visible {
    outline: 2px solid #ff747b;
    outline-offset: 3px;
}
.bip-public .modal-content, .bip-public .form-container {
    background: rgba(20, 22, 25, .96);
    color: #e5e5e5;
    border: 1px solid #36383c;
    border-radius: 6px;
    box-shadow: 0 20px 70px rgba(0, 0, 0, .55);
}
.bip-public .modal-dialog { margin: 16px auto; width: calc(100% - 32px); max-width: 480px; }
.bip-public .modal-content { padding: 8px; }
.bip-public .modal-header { gap: 12px; }
.bip-public .modal-body { padding: 20px 16px; }
.bip-public .modal-backdrop { --bs-backdrop-opacity: .75; }
.bip-public .btn-close { filter: invert(1) grayscale(1); min-width: 44px; min-height: 44px; padding: 0; }
.bip-public :is(p, h1, h2, h3, h4, h5, .form-container .header) { color: #e5e5e5; }
.bip-public .form-container .header { font-size: clamp(1.7rem, 7vw, 2.2rem); line-height: 1.15; font-stretch: normal; }
.bip-public :is(.text-muted, small) { color: #929292 !important; }
.bip-public a, .bip-public .btn-link { color: #e5e5e5; --bs-btn-color: #e5e5e5; --bs-btn-hover-color: #ff747b; --bs-btn-active-color: #ff747b; }
.bip-public a.text-success { color: #e5e5e5 !important; }
.bip-public a:hover { color: #ff747b !important; }
.bip-public :is(.form-control, .input-group-text, .form-check-input) {
    background-color: #1c1e22;
    border-color: #36383c;
    color: #e5e5e5;
    border-radius: 4px;
}
.bip-public .form-control { min-height: 48px; font-size: 16px; }
.bip-public .form-control.bg-light { background-color: #1c1e22 !important; color: #929292; }
.bip-public .form-control::placeholder { color: #929292; opacity: 1; }
.bip-public .form-control:focus, .bip-public .input-group:focus-within .input-group-text {
    background-color: #1c1e22;
    color: #e5e5e5;
    border-color: #c52b32;
    box-shadow: 0 0 0 3px rgba(197, 43, 50, .18) !important;
}
.bip-public input:-webkit-autofill, .bip-public input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #1c1e22 inset !important;
    -webkit-text-fill-color: #e5e5e5;
    caret-color: #e5e5e5;
}
.bip-public input:autofill { background-color: #1c1e22 !important; color: #e5e5e5 !important; }
.bip-public input:-moz-ui-valid { background-color: #1c1e22 !important; }
.bip-public .form-check-input:checked { background-color: #c52b32; border-color: #c52b32; }
.bip-public .form-check { min-height: 44px; padding-top: 8px; }
.bip-public .form-check-label { cursor: pointer; }
.bip-public :is(.invalid-feedback, .text-error, .error-message) { color: #ff747b; }
.bip-public .invalid-feedback.position-absolute { position: static !important; margin-top: 8px; line-height: 1.4 !important; }
.bip-public .form-control.is-invalid, .bip-public .phone-group.has-error .input-group-text { border-color: #ff747b; }
.bip-public .toggle-password { min-width: 44px; min-height: 44px; opacity: 1 !important; }
.bip-public input[type=password] { padding-right: 52px; }
.bip-public #loginForm > .d-flex { flex-wrap: wrap; gap: 8px 16px; }
.bip-public #loginForm a { display: inline-flex; align-items: center; min-height: 44px; }
.bip-public .otp-input { width: min(56px, 18vw); min-width: 0; padding: 6px; font-size: 1.5rem; }
body.bip-auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    background-image: linear-gradient(rgba(8, 9, 11, .88), rgba(8, 9, 11, .96)), url('/images/landing/bip-checkpoint.webp');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}
.bip-public .bip-registration { width: min(100%, 512px); margin: 0 auto; padding: 32px 16px max(24px, env(safe-area-inset-bottom)); }
.bip-public .bip-registration-body { display: flex; min-width: 0; }
.bip-public .form-container { width: 100%; min-width: 0; max-width: 480px; padding: clamp(20px, 5vw, 36px) !important; }
.bip-public .bip-auth-navigation { text-align: center; margin-top: 16px; }
.bip-public .bip-auth-navigation a { display: inline-flex; min-height: 48px; align-items: center; }
@media (max-width: 575.98px) {
    .bip-public .bip-landing-actions { flex-direction: column; gap: 12px; max-width: 360px; }
    .bip-public .bip-checkpoint {
        /* Limit side cropping to keep the embedded central title within the viewport. */
        background-size: 100% 100%, min(150vw, 66.667vh) auto;
        background-size: 100% 100%, min(150vw, 66.667dvh) auto;
        background-position: center, center 18%;
    }
    .bip-public .bip-registration { padding-top: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    .bip-public .btn { transition: none; }
    .bip-public .modal.fade .modal-dialog { transition: none; }
}
