html:has(body.baipar-auth-document),
body.baipar-auth-document { min-height: 100%; margin: 0; }
body.baipar-auth-document { overflow: hidden; background: #ede9f8; color: #171522; }

.baipar-auth-layout {
    min-height: 100svh;
    display: grid;
    grid-template-columns: var(--baipar-auth-image-width, 52%) minmax(0, 1fr);
    overflow: hidden;
    background: #eee9f8;
}
.baipar-auth-visual {
    position: relative;
    min-width: 0;
    background-image: var(--baipar-auth-image);
    background-position: var(--baipar-auth-position, left center);
    background-size: cover;
    background-repeat: no-repeat;
}
.baipar-auth-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--baipar-auth-overlay, #4c0cad);
    opacity: var(--baipar-auth-overlay-opacity, .18);
    pointer-events: none;
}
.baipar-auth-panel {
    position: relative;
    z-index: 1;
    min-width: 0;
    max-height: 100svh;
    margin-left: -34px;
    overflow-y: auto;
    border-radius: 36px 0 0 36px;
    background: var(--baipar-auth-panel, #fff);
    box-shadow: -18px 0 50px rgba(23, 15, 65, .12);
    scrollbar-width: thin;
}
.baipar-auth-panel-inner {
    width: min(100%, 520px);
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0 auto;
    padding: clamp(34px, 6vh, 64px) clamp(28px, 5vw, 64px);
}
.baipar-auth-layout .baipar-auth-page {
    min-height: 0;
    display: block;
    padding: 0;
    background: transparent;
}
.baipar-auth-layout .baipar-auth-card {
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: center;
}
.baipar-auth-brand {
    width: 142px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 28px;
    text-decoration: none;
}
.baipar-auth-logo { width: 100%; height: auto; display: block; }
.baipar-auth-title {
    margin: 0;
    color: #171522;
    font-size: clamp(25px, 2.2vw, 32px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.15;
}
.baipar-auth-subtitle { margin: 9px 0 30px; color: #898595; font-size: 13px; }
.baipar-auth-form { display: flex; flex-direction: column; gap: 16px; text-align: left; }
.baipar-auth-name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.baipar-auth-field { display: flex; flex-direction: column; gap: 7px; }
.baipar-auth-field label { color: #85818f; font-size: 11px; font-weight: 600; }
.baipar-auth-field input[type="text"],
.baipar-auth-field input[type="email"],
.baipar-auth-field input[type="password"],
.baipar-auth-field input[type="tel"] {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 1px solid #dedbe5;
    border-radius: 6px;
    outline: 0;
    background: #fff;
    color: #24202d;
    font: inherit;
    font-size: 12px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.baipar-auth-field input:focus { border-color: var(--baipar-auth-accent, #7138f5); box-shadow: 0 0 0 3px color-mix(in srgb, var(--baipar-auth-accent, #7138f5) 14%, transparent); }
.baipar-auth-field input::placeholder { color: #aaa6b2; }
.baipar-auth-password-wrapper { position: relative; }
.baipar-auth-password-wrapper input { padding-right: 47px !important; }
.baipar-auth-toggle-password {
    position: absolute;
    top: 50%;
    right: 0;
    width: 46px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #898594;
    cursor: pointer;
}
.baipar-auth-eye { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.baipar-auth-password-wrapper:has(input[type="text"]) .baipar-auth-toggle-password { color: var(--baipar-primary, #e11b22); }
.baipar-auth-options { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: #85818f; font-size: 11px; }
.baipar-auth-remember, .baipar-auth-terms { display: flex; align-items: flex-start; gap: 8px; color: #85818f; font-size: 11px; line-height: 1.5; }
.baipar-auth-remember input, .baipar-auth-terms input { accent-color: var(--baipar-auth-accent, #7138f5); }
.baipar-auth-forgot, .baipar-auth-terms a, .baipar-auth-footer a { color: var(--baipar-auth-accent, #7138f5); font-weight: 700; text-decoration: none; }
.baipar-auth-submit {
    width: 100%;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: var(--baipar-primary, #e11b22);
    color: #fff !important;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(225, 27, 34, .22);
}
.baipar-auth-submit .baipar-btn-text { color: #fff !important; text-decoration: none !important; }
.baipar-auth-submit:hover, .baipar-auth-submit:focus { background: var(--baipar-secondary, #0d1b34); color: #fff !important; }
.baipar-auth-submit:hover .baipar-btn-text, .baipar-auth-submit:focus .baipar-btn-text { color: #fff !important; }
.baipar-auth-submit:hover { transform: translateY(-1px); }
.baipar-auth-submit:disabled { opacity: .65; cursor: not-allowed; }
.baipar-btn-loader { display: none; }
.baipar-auth-divider { display: flex; align-items: center; gap: 13px; margin: 3px 0 0; color: #aaa6b2; font-size: 10px; text-align: center; }
.baipar-auth-divider::before, .baipar-auth-divider::after { height: 1px; flex: 1; content: ""; background: #e7e4eb; }
.baipar-auth-socials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.baipar-auth-social-btn {
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 12px;
    border: 1px solid #dedbe5;
    border-radius: 7px;
    background: #fff;
    color: #4c4854;
    font-size: 11px;
    font-weight: 650;
    cursor: default;
}
.baipar-auth-social-btn svg { width: 19px; height: 19px; flex: 0 0 19px; }
/* These used to be decorative, so they carried cursor:default. They work now. */
.baipar-auth-social-btn { cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.baipar-auth-social-btn:hover:not(:disabled) { border-color: #bdb7cb; background: #fbfafd; }
.baipar-auth-social-btn:active:not(:disabled) { transform: translateY(1px); }
.baipar-auth-social-btn:focus-visible { outline: 2px solid var(--baipar-auth-accent, #7138f5); outline-offset: 2px; }
.baipar-auth-social-btn:disabled { opacity: .55; cursor: progress; }
/* One provider should fill the row rather than sit at half width. */
.baipar-auth-socials--single { grid-template-columns: minmax(0, 1fr); }

.baipar-social-message { margin: 0; padding: 10px 12px; border-radius: 7px; font-size: 11px; line-height: 1.5; }
.baipar-social-message.is-error { background: #fff0f0; color: #a5141a; }
.baipar-social-message.is-busy { background: #f4f3f7; color: #6f6a7a; }
.baipar-social-message[hidden] { display: none; }

/* Shown only when a social sign-in matches an account that already exists. */
.baipar-social-link { display: grid; gap: 9px; padding: 14px; border: 1px solid #e2def0; border-radius: 9px; background: #faf9fd; }
.baipar-social-link[hidden] { display: none; }
.baipar-social-link__intro { margin: 0; font-size: 11.5px; line-height: 1.55; color: #4c4854; }
.baipar-social-link__label { font-size: 11px; font-weight: 650; color: #4c4854; }
.baipar-social-link__input { height: 44px; padding: 0 13px; border: 1px solid #dedbe5; border-radius: 7px; background: #fff; font: inherit; font-size: 13px; outline: 0; }
.baipar-social-link__input:focus { border-color: var(--baipar-auth-accent, #7138f5); }
.baipar-social-link__go { margin: 0; }
.baipar-social-link__help { margin: 0; font-size: 11px; text-align: center; }
.baipar-auth-footer { margin-top: 3px; color: #85818f; font-size: 11px; text-align: center; }
.baipar-form-message { padding: 10px 12px; border-radius: 7px; font-size: 11px; }
.baipar-message-error { background: #fff0f0; color: #a5141a; }
.baipar-message-success { background: #edf9f0; color: #1d7335; }
.baipar-auth-site-socials { display: flex; align-items: center; justify-content: center; gap: 21px; margin-top: 23px; }
.baipar-auth-site-socials a { display: grid; place-items: center; color: #777280; transition: color .18s ease, transform .18s ease; }
.baipar-auth-site-socials a:hover { color: var(--baipar-auth-accent, #7138f5); transform: translateY(-2px); }
.baipar-auth-site-socials svg { width: 17px; height: 17px; }
.baipar-auth-panel-inner:has([data-baipar-register-form]) { width: min(100%, 680px); }
.baipar-auth-form[data-baipar-register-form] { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.baipar-auth-form[data-baipar-register-form] > .baipar-auth-name-row,
.baipar-auth-form[data-baipar-register-form] > .baipar-auth-field:has(input[name="username"]),
.baipar-auth-form[data-baipar-register-form] > .baipar-auth-terms,
.baipar-auth-form[data-baipar-register-form] > .baipar-auth-submit,
.baipar-auth-form[data-baipar-register-form] > .baipar-form-message,
.baipar-auth-form[data-baipar-register-form] > .baipar-auth-divider,
.baipar-auth-form[data-baipar-register-form] > .baipar-auth-socials,
.baipar-auth-form[data-baipar-register-form] > .baipar-auth-footer { grid-column: 1 / -1 !important; }
.baipar-auth-form[data-baipar-register-form] > .baipar-auth-field:has(input[name="email"]),
.baipar-auth-form[data-baipar-register-form] > .baipar-auth-field:has(input[name="phone"]) { min-width: 0; grid-column: span 1 !important; }

@media (max-width: 900px) {
    .baipar-auth-layout { grid-template-columns: 42% minmax(0, 1fr); }
    .baipar-auth-panel-inner { padding-inline: 34px; }
    .baipar-auth-form[data-baipar-register-form] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-name-row,
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-field:has(input[name="username"]),
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-terms,
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-submit,
    .baipar-auth-form[data-baipar-register-form] > .baipar-form-message,
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-divider,
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-socials,
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-footer { grid-column: 1 / -1; }
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-field:has(input[name="email"]),
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-field:has(input[name="phone"]) { min-width: 0; grid-column: span 1; }
}
@media (max-width: 720px) {
    body.baipar-auth-document { overflow-y: auto; }
    .baipar-auth-layout { display: block; background: var(--baipar-auth-panel, #fff); }
    .baipar-auth-visual { display: none; }
    .baipar-auth-panel { min-height: 100svh; max-height: none; margin: 0; overflow: visible; border-radius: 0; box-shadow: none; }
    .baipar-auth-panel-inner { width: min(100%, 520px); min-height: 100svh; padding: 34px 24px; }
    body.baipar-auth-document:has([data-baipar-register-form]) { overflow: hidden; }
    .baipar-auth-panel:has([data-baipar-register-form]) { height: 100svh; min-height: 0; overflow: hidden; }
    .baipar-auth-panel-inner:has([data-baipar-register-form]) { width: 100%; min-height: 0; height: 100svh; padding: 34px 24px; }
    .baipar-auth-panel-inner:has([data-baipar-register-form]) .baipar-auth-title { font-size: 21px; }
    .baipar-auth-panel-inner:has([data-baipar-register-form]) .baipar-auth-subtitle { margin: 4px 0 12px; font-size: 11px; }
    .baipar-auth-form[data-baipar-register-form] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-name-row { grid-column: 1 / -1; }
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-field:has(input[name="username"]) { grid-column: 1 / -1; }
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-field:has(input[name="email"]),
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-field:has(input[name="phone"]) { min-width: 0; grid-column: span 1; }
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-terms,
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-submit,
    .baipar-auth-form[data-baipar-register-form] > .baipar-form-message,
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-divider,
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-socials,
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-footer { grid-column: 1 / -1; }
    .baipar-auth-form[data-baipar-register-form] .baipar-auth-name-row { gap: 10px; }
    .baipar-auth-form[data-baipar-register-form] .baipar-auth-field { gap: 4px; }
    .baipar-auth-form[data-baipar-register-form] .baipar-auth-field label { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
    .baipar-auth-form[data-baipar-register-form] .baipar-auth-field input { height: 40px; padding-inline: 9px; font-size: 10px; }
    .baipar-auth-form[data-baipar-register-form] .baipar-auth-terms { font-size: 9px; line-height: 1.3; }
    .baipar-auth-form[data-baipar-register-form] .baipar-auth-submit { min-height: 42px; }
    .baipar-auth-form[data-baipar-register-form] .baipar-auth-social-btn { height: 38px; font-size: 9px; }
    .baipar-auth-panel-inner:has([data-baipar-register-form]) .baipar-auth-site-socials { margin-top: 10px; }
}
@media (max-width: 600px) {
    body.baipar-auth-document:has([data-baipar-register-form]) { overflow-y: auto; }
    .baipar-auth-panel:has([data-baipar-register-form]) { height: auto; min-height: 100svh; overflow: visible; }
    .baipar-auth-panel-inner:has([data-baipar-register-form]) { height: auto; min-height: 100svh; justify-content: flex-start; }
    .baipar-auth-form[data-baipar-register-form] { grid-template-columns: minmax(0, 1fr); }
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-field:has(input[name="username"]),
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-field:has(input[name="email"]),
    .baipar-auth-form[data-baipar-register-form] > .baipar-auth-field:has(input[name="phone"]) { grid-column: 1 / -1 !important; }
    .baipar-auth-form[data-baipar-register-form] .baipar-auth-name-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
    .baipar-auth-brand { width: 124px; margin-bottom: 22px; }
    .baipar-auth-title { font-size: 24px; }
    .baipar-auth-form[data-baipar-register-form] { gap: 6px 7px; }
    .baipar-auth-form[data-baipar-register-form] .baipar-auth-field input { padding-inline: 6px; font-size: 9px; }
    .baipar-auth-form[data-baipar-register-form] .baipar-auth-social-btn { padding-inline: 6px; }
}
@media (prefers-reduced-motion: reduce) {
    .baipar-auth-submit, .baipar-auth-site-socials a { transition: none; }
}
