/*
 * BioWave sign-in pages: login and on-prem first-run setup.
 * Navy brand panel on one side, form on the other. Tokens live on .bw-setup-body.
 */
.bw-setup-body {
    --bw-ink: #193251;
    --bw-ink-deep: #10233b;
    --bw-paper: #f3f5f8;
    --bw-field: #ffffff;
    --bw-line: #cdd5df;
    --bw-muted: #5a6778;
    --bw-ok: #1f7a4d;
    --bw-error: #b42318;
    --bw-focus: rgba(25, 50, 81, .2);
    background: var(--bw-paper);
    color: #1d2733;
    font-family: 'Inter', system-ui, sans-serif;
}
html[dir='rtl'] .bw-setup-body { font-family: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif; }

.bw-setup { display: grid; grid-template-columns: minmax(300px, 38%) 1fr; min-height: 100vh; }

/* Brand panel: what setup creates. */
.bw-setup__panel { position: sticky; top: 0; height: 100vh; overflow: hidden; background: var(--bw-ink); color: #e6edf5; }
.bw-setup__panel .tsparticles-canvas-el { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; opacity: .35; }
.bw-setup__panel-inner { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; overflow-y: auto; padding: 56px 48px 32px; }
.bw-setup__logo { width: 190px; height: auto; margin-bottom: 72px; }
.bw-setup__panel-title { font-size: 28px; line-height: 1.2; font-weight: 600; color: #fff; margin: 0 0 28px; max-width: 16ch; }
.bw-setup__lead { font-size: 14px; color: #a9b8ca; margin: 0 0 12px; }
.bw-setup__creates { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 14px; max-width: 34ch; }
.bw-setup__creates li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 15px; line-height: 1.45; }
.bw-setup__creates .material-symbols-outlined { font-size: 20px; color: #8fd3b4; line-height: 1.1; }
.bw-setup__after { font-size: 14px; line-height: 1.55; color: #a9b8ca; max-width: 36ch; margin: 0; }
.bw-setup__copyright { margin-top: auto; padding-top: 40px; font-size: 12px; color: #8094ab; }

/* Form column */
.bw-setup__main { display: flex; justify-content: center; padding: 56px 32px 64px; }
.bw-setup__form { width: 100%; max-width: 560px; }
.bw-setup__title { font-size: 30px; line-height: 1.15; font-weight: 700; color: var(--bw-ink); margin: 0 0 10px; letter-spacing: -.01em; }
.bw-setup__intro { font-size: 15px; line-height: 1.55; color: var(--bw-muted); margin: 0 0 32px; max-width: 52ch; }

.bw-setup__group { border: 0; border-top: 1px solid #dde3ea; margin: 0; padding: 28px 0 4px; min-width: 0; }
.bw-setup__legend { float: left; width: 100%; font-size: 17px; font-weight: 600; color: var(--bw-ink); margin: 0 0 14px; padding: 0; }
.bw-setup__legend + * { clear: both; }
.bw-setup__legend:has(+ .bw-setup__group-help) { margin-bottom: 2px; }
.bw-setup__group-help { font-size: 14px; color: var(--bw-muted); margin: 0 0 16px; }
.bw-setup__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.bw-field { margin-bottom: 18px; }
.bw-field label { display: block; font-size: 14px; font-weight: 500; color: #263445; margin-bottom: 6px; }
.bw-field__help { display: block; font-size: 13px; line-height: 1.45; color: var(--bw-muted); margin-top: 6px; }
.bw-field__error { display: block; font-size: 13px; line-height: 1.45; color: var(--bw-error); margin-top: 6px; }
.bw-setup .bw-input {
    display: block; width: 100%; height: 44px; padding: 0 12px; font: inherit; font-size: 15px; color: #1d2733;
    background: var(--bw-field); border: 1px solid var(--bw-line); border-radius: 6px; box-shadow: none;
    transition: border-color .15s, box-shadow .15s;
}
.bw-setup select.bw-input {
    appearance: none; -webkit-appearance: none; padding-inline-end: 44px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235a6778' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-size: 12px 8px; background-position: right 16px center;
}
html[dir='rtl'] .bw-setup select.bw-input { background-position: left 16px center; }
.bw-setup .bw-input:focus { outline: none; border-color: var(--bw-ink); box-shadow: 0 0 0 3px var(--bw-focus); }
.bw-setup .bw-input[aria-invalid='true'] { border-color: var(--bw-error); }

/* Setup code: the one moment that ties the page to the server. */
.bw-handshake { background: #fff; border: 1px solid var(--bw-line); border-radius: 8px; padding: 20px; margin-bottom: 32px; }
.bw-handshake label { font-size: 15px; font-weight: 600; color: var(--bw-ink); margin-bottom: 4px; }
.bw-handshake__help { font-size: 14px; color: var(--bw-muted); margin: 0 0 10px; }
.bw-cmd { display: flex; align-items: center; gap: 8px; background: var(--bw-ink-deep); border-radius: 6px; padding: 10px 10px 10px 14px; margin-bottom: 14px; direction: ltr; }
.bw-cmd code { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.5; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: #dce6f2; background: none; padding: 0; }
.bw-cmd code::before { content: '$ '; color: #6f86a1; }
.bw-cmd__copy { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; font: inherit; font-size: 13px; font-weight: 500; color: #dce6f2; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); border-radius: 4px; cursor: pointer; }
.bw-cmd__copy:hover { background: rgba(255, 255, 255, .14); }
.bw-cmd__copy:focus-visible { outline: 2px solid #8fb6e0; outline-offset: 2px; }
.bw-setup .bw-cmd__copy .material-symbols-outlined { font-size: 16px; color: #fff !important; }
.bw-setup .bw-code-input {
    height: 56px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 22px; font-weight: 600;
    letter-spacing: .2em; text-transform: uppercase; color: var(--bw-ink); direction: ltr; text-align: left;
}
.bw-setup .bw-code-input::placeholder { color: #b5c0cc; font-weight: 500; }

/* Password with show/hide */
.bw-password { position: relative; }
.bw-password .bw-input { padding-inline-end: 48px; }
.bw-password__toggle {
    position: absolute; inset-block: 0; inset-inline-end: 0; width: 44px; display: grid; place-items: center;
    background: none; border: 0; border-radius: 0 6px 6px 0; color: var(--bw-muted); cursor: pointer;
}
html[dir='rtl'] .bw-password__toggle { border-radius: 6px 0 0 6px; }
.bw-password__toggle:hover { color: var(--bw-ink); }
.bw-password__toggle:focus-visible { outline: 2px solid var(--bw-ink); outline-offset: -4px; }
.bw-password__toggle .material-symbols-outlined { font-size: 20px; }

.bw-rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.bw-rules li, .bw-match { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--bw-muted); }
.bw-rules .material-symbols-outlined, .bw-match .material-symbols-outlined { font-size: 16px; }
.bw-rules li.is-met { color: var(--bw-ok); }
.bw-match { margin-top: 6px; min-height: 18px; }
.bw-match.is-met { color: var(--bw-ok); }
.bw-match.is-unmet { color: var(--bw-error); }

.bw-setup__submit {
    display: block; width: 100%; height: 50px; margin-top: 12px; font: inherit; font-size: 16px; font-weight: 600; color: #fff;
    background: var(--bw-ink); border: 1px solid var(--bw-ink); border-radius: 6px; cursor: pointer; transition: background .15s;
}
.bw-setup__submit:hover { background: var(--bw-ink-deep); }
.bw-setup__submit:focus-visible { outline: 3px solid var(--bw-focus); outline-offset: 2px; }

@media (max-width: 900px) {
    .bw-setup { grid-template-columns: 1fr; }
    .bw-setup__panel { position: relative; height: auto; }
    .bw-setup__panel-inner { padding: 28px 16px 24px; }
    .bw-setup__logo { width: 150px; margin-bottom: 24px; }
    .bw-setup__panel-title { font-size: 22px; margin-bottom: 16px; max-width: none; }
    .bw-setup__copyright { display: none; }
    .bw-setup__main { padding: 32px 16px 48px; }
    .bw-setup__title { font-size: 26px; }
}
@media (max-width: 560px) {
    .bw-setup__row, .bw-rules { grid-template-columns: 1fr; }
    .bw-handshake { padding: 16px; }
    .bw-setup .bw-code-input { font-size: 18px; letter-spacing: .12em; }
}
@media (prefers-reduced-motion: reduce) {
    .bw-setup__panel .tsparticles-canvas-el { display: none; }
    .bw-setup * { transition: none !important; }
}

/* ---- Login page ---- */
.bw-setup .bw-label { display: block; font-size: 14px; font-weight: 500; color: #263445; margin-bottom: 6px; }
.bw-setup .form-group.bw-field { margin-bottom: 24px; }
.bw-login .bw-setup__main { align-items: center; }
.bw-login .bw-login__card { max-width: 420px; }

/* Brand panel: logo on top, statement and product areas anchored to the lower half. */
.bw-login .bw-setup__logo { margin-bottom: 0; }
.bw-login__hero { margin-top: auto; padding-top: 48px; }
.bw-login__headline {
    margin: 0 0 18px; max-width: 16ch; font-size: clamp(32px, 3.1vw, 46px); line-height: 1.08; text-wrap: balance;
    font-weight: 600; letter-spacing: -0.025em; color: #fff;
}
.bw-login__lead { margin: 0; max-width: 34ch; font-size: 16px; line-height: 1.55; color: #b9c8d9; }
.bw-login__areas { margin: 44px 0 0; display: grid; }
.bw-login__area { padding: 16px 0; border-top: 1px solid rgba(255, 255, 255, .14); display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; }
.bw-login__area:last-child { border-bottom: 1px solid rgba(255, 255, 255, .14); }
.bw-login__area dt { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; font-weight: 600; color: #fff; }
.bw-login__area dt .material-symbols-outlined { font-size: 20px; color: #9fc3e6; }
.bw-login__area dd { margin: 0; font-size: 14px; line-height: 1.5; color: #b9c8d9; }
.bw-login .bw-setup__copyright { margin-top: 0; padding-top: 32px; }
html[dir='rtl'] .bw-login__headline { letter-spacing: 0; line-height: 1.25; }
@media (max-width: 1180px) {
    .bw-login__area { grid-template-columns: 1fr; gap: 4px; }
}

/* SSO steps (sso::partials.login-button) in the same look. */
.bw-setup .sso-entry,
.bw-setup .sso-required { margin: 24px 0 0; }
.bw-setup .sso-or { margin-bottom: 16px; color: var(--bw-muted); }
.bw-setup .sso-or::before,
.bw-setup .sso-or::after { background: #dde3ea; }
.bw-setup .sso-alt-button {
    min-height: 48px; font-size: 15px; font-weight: 500; color: var(--bw-ink);
    background: #fff; border: 1px solid var(--bw-line); border-radius: 6px;
}
.bw-setup .sso-alt-button:hover { border-color: var(--bw-ink); background: #fff; }
.bw-setup .sso-alt-button:focus-visible { box-shadow: 0 0 0 3px var(--bw-focus); border-color: var(--bw-ink); }
.bw-setup .sso-step__logo { display: none; }
.bw-setup .sso-step__title { font-size: 30px; line-height: 1.15; font-weight: 700; color: var(--bw-ink); margin: 0 0 10px; }
.bw-setup .sso-step__lead { font-size: 15px; line-height: 1.55; color: var(--bw-muted); margin: 0 0 28px; }
.bw-setup .sso-step label { display: block; font-size: 14px; font-weight: 500; color: #263445; margin-bottom: 6px; }
.bw-setup .sso-step .form-group { margin-bottom: 20px; }
.bw-setup .sso-step .form-control {
    height: 44px; padding: 0 12px; font-size: 15px; border: 1px solid var(--bw-line); border-radius: 6px; box-shadow: none;
}
.bw-setup .sso-step .form-control:focus { border-color: var(--bw-ink); box-shadow: 0 0 0 3px var(--bw-focus); }
.bw-setup .sso-step .btn-primary,
.bw-setup .sso-required .btn-primary {
    height: 50px; font-size: 16px; font-weight: 600; background: var(--bw-ink) !important;
    border: 1px solid var(--bw-ink) !important; border-radius: 6px;
}
.bw-setup .sso-step .btn-primary:hover,
.bw-setup .sso-required .btn-primary:hover { background: var(--bw-ink-deep) !important; }
.bw-setup .sso-required__text { border-radius: 6px; font-size: 14px; }
.bw-login__messages .alert { margin: 0 0 20px; padding: 12px 14px; font-size: 14px; border-radius: 6px; }
.bw-login__messages .col-xs-12 { padding: 0; }
.bw-login__limit strong { font-variant-numeric: tabular-nums; }
/* Locked while the sign-in countdown runs (partials.sign-in-limit). */
.bw-setup__submit:disabled:not(.is-loading) { opacity: .5; cursor: not-allowed; }
@media (max-width: 900px) {
    /* On phones the login panel is just the logo, so the form starts on screen. */
    .bw-login__hero,
    .bw-login__areas { display: none; }
    .bw-login .bw-setup__logo { margin-bottom: 0; }
}

/* ---- SSO pages on the sign-in layout (confirm account, Active Directory, error, app return) ---- */
.bw-auth-icon {
    display: inline-grid; place-items: center; width: 48px; height: 48px; margin-bottom: 20px;
    border-radius: 50%; background: rgba(25, 50, 81, .08); color: var(--bw-ink);
}
.bw-setup .bw-auth-icon .material-symbols-outlined { font-size: 26px; color: inherit !important; }
.bw-auth-icon--error { background: rgba(180, 35, 24, .08); color: var(--bw-error); }
.bw-auth-icon--ok { background: rgba(31, 122, 77, .1); color: var(--bw-ok); }
a.bw-setup__submit { display: grid; place-items: center; text-decoration: none; }
a.bw-setup__submit:hover { color: #fff; }
.bw-setup .bw-auth-or { margin: 24px 0 16px; }
.bw-setup .sso-alt-button { text-decoration: none; }
.bw-alert { margin: 0 0 20px; padding: 12px 14px; font-size: 14px; line-height: 1.5; border-radius: 6px; border: 1px solid; }
.bw-alert--info { color: var(--bw-ink); background: rgba(25, 50, 81, .05); border-color: rgba(25, 50, 81, .15); }
.bw-alert--error { color: var(--bw-error); background: rgba(180, 35, 24, .06); border-color: rgba(180, 35, 24, .2); }
.bw-auth-back {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; font-size: 14px; font-weight: 500;
    color: var(--bw-muted); text-decoration: none;
}
.bw-auth-back:hover { color: var(--bw-ink); }
.bw-auth-back .material-symbols-outlined { font-size: 18px; }
html[dir='rtl'] .bw-auth-back .material-symbols-outlined { transform: scaleX(-1); }
.bw-auth-reference {
    margin: 24px 0 0; padding-top: 16px; border-top: 1px solid #dde3ea; font-size: 12px; color: var(--bw-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere;
}
.bw-account-choice {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; text-align: start;
    color: var(--bw-ink); background: #fff; border: 1px solid var(--bw-line); border-radius: 6px; cursor: pointer;
    transition: border-color .15s;
}
.bw-account-choice:hover { border-color: var(--bw-ink); }
.bw-account-choice:focus-visible { outline: none; border-color: var(--bw-ink); box-shadow: 0 0 0 3px var(--bw-focus); }
.bw-account-choice__initial {
    flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
    background: rgba(25, 50, 81, .1); font-weight: 600; font-size: 16px;
}
.bw-account-choice__text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.bw-account-choice__label { font-size: 13px; color: var(--bw-muted); }
.bw-account-choice__email { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bw-account-choice__go { color: var(--bw-muted); font-size: 20px; }
html[dir='rtl'] .bw-account-choice__go { transform: scaleX(-1); }
@media (prefers-reduced-motion: reduce) { .bw-account-choice { transition: none; } }
