/* Isolated Account-authentication surface. No dashboard/Worker cascade. */
.bayleo-auth {
    --auth-ink: #143f43;
    --auth-muted: #526565;
    --auth-teal: #083e40;
    --auth-mint: #a0ebcf;
    --auth-border: #d4dfdc;
    margin: 0;
    background: #f4f5f0;
    color: var(--auth-ink);
    font: 16px/1.55 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-text-size-adjust: 100%;
}
.bayleo-auth *, .bayleo-auth *::before, .bayleo-auth *::after { box-sizing: border-box; }
.bayleo-auth [hidden] { display: none !important; }
.bayleo-auth a { color: var(--auth-teal); text-underline-offset: 4px; }
.bayleo-auth :focus-visible { outline: 3px solid #147c68; outline-offset: 4px; }
.auth-skip { position: fixed; top: 12px; left: 12px; z-index: 2; padding: 12px 18px; background: white; border: 1px solid; border-radius: 8px; transform: translateY(-180%); }
.auth-skip:focus { transform: none; }
.auth-page { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 32px 24px; }
.auth-frame { display: grid; grid-template-columns: 44% minmax(0, 1fr); width: min(1160px, 100%); background: #fff; border: 1px solid var(--auth-border); border-radius: 24px; box-shadow: 0 16px 48px #163f3a09; }
.auth-identity { min-width: 0; min-height: 536px; display: flex; flex-direction: column; justify-content: space-between; gap: 36px; padding: 46px; background: var(--auth-teal); color: #fff; border-radius: 23px 0 0 23px; }
.auth-wordmark { display: block; width: 142px; max-width: 100%; height: auto; filter: brightness(0) invert(1); }
.auth-story { margin-top: auto; }
.auth-eyebrow, .admin-mfa-eyebrow { margin: 0 0 18px; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.auth-identity .auth-eyebrow { color: #c3dcd5; }
.auth-story-title { margin: 0; font-size: clamp(32px, 3.5vw, 46px); font-weight: 650; letter-spacing: -.045em; line-height: 1.12; }
.auth-story-title span { color: var(--auth-mint); }
.auth-brand-line { margin: auto 0 0; color: #c3dcd5; font-size: 13px; }
.auth-card { min-width: 0; width: 100%; max-width: 624px; align-self: center; justify-self: center; padding: 56px 64px 32px; }
.auth-card h1 { font-size: clamp(28px, 2.7vw, 36px); line-height: 1.16; letter-spacing: -.035em; font-weight: 680; margin: 0 0 14px; overflow-wrap: break-word; }
.auth-card p { margin: 0 0 24px; color: var(--auth-muted); }
.auth-card .admin-mfa-eyebrow { color: #287563; margin-bottom: 14px; }
.auth-form { display: grid; gap: 22px; margin-top: 30px; }
.auth-form label { display: grid; gap: 8px; font-size: 14px; font-weight: 650; }
.auth-form input:not([type="hidden"]):not([type="checkbox"]) { width: 100%; min-width: 0; min-height: 50px; border: 1px solid #7a9389; border-radius: 10px; background: #fcfdfa; color: var(--auth-ink); padding: 12px 14px; font: inherit; font-size: 16px; line-height: 1.4; box-shadow: inset 0 1px 2px #143f4305; }
.auth-form input:hover { border-color: #74958b; }
.auth-form input[aria-invalid="true"] { border-color: #a33930; }
.auth-form input:focus-visible { border-color: #147c68; outline-offset: 2px; }
.auth-help { display: block; color: var(--auth-muted); font-size: 12px; font-weight: 400; }
.auth-submit { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; border: 1px solid var(--auth-teal); border-radius: 10px; padding: 12px 16px; background: var(--auth-teal); color: white; box-shadow: 0 2px 3px #083e4010; font: inherit; font-size: 15px; font-weight: 650; cursor: pointer; }
.auth-submit:hover { background: #115354; }
.auth-submit:active { background: #062f31; }
.auth-submit.secondary { background: white; color: var(--auth-teal); border-color: #b8cac5; }
.auth-submit.secondary:hover { background: #edf6f0; }
.auth-form[aria-busy="true"] .auth-submit { cursor: progress; }
.auth-error { border: 1px solid #e7c7bd; border-left: 3px solid #a33930; background: #fff5f1; color: #822e26; padding: 12px 14px; border-radius: 7px; font-size: 14px; margin: 20px 0; overflow-wrap: anywhere; }
.auth-links { border-top: 1px solid #e3e9e5; margin-top: 28px; padding-top: 16px; color: var(--auth-muted); font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.auth-links a, .admin-mfa-back { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 650; }
.auth-card .auth-pending { min-height: 22px; margin: 12px 0 0; font-size: 13px; }
.auth-legal { margin-top: 14px; padding-top: 20px; border-top: 1px solid #e3e9e5; color: #5a6b66; font-size: 12px; line-height: 1.6; }
.auth-legal span { display: inline-block; }
.auth-card details { border: 1px solid var(--auth-border); border-radius: 9px; margin: 22px 0 0; padding: 0 14px; }
.auth-card summary { min-height: 48px; padding: 12px 0; font-size: 14px; font-weight: 650; cursor: pointer; }
.auth-card details[open] { padding-bottom: 16px; }
.auth-card details .auth-form { margin-top: 8px; }
.admin-mfa-qr { display: flex; justify-content: center; padding: 14px; margin: 20px 0; background: white; border: 1px solid var(--auth-border); border-radius: 12px; }
.admin-mfa-qr svg { width: min(220px, 100%); height: auto; }
.admin-mfa-identity { display: grid; gap: 8px; font-size: 13px; }
.admin-mfa-identity div { display: grid; grid-template-columns: 65px minmax(0, 1fr); gap: 12px; }
.admin-mfa-identity dt { color: var(--auth-muted); }
.admin-mfa-identity dd { margin: 0; overflow-wrap: anywhere; }
.admin-mfa-manual code { display: block; padding: 12px; background: #eff4f0; overflow-wrap: anywhere; user-select: all; font-size: 14px; }
.admin-mfa-manual p { font-size: 14px; margin-bottom: 12px; }
.admin-mfa-status { display: grid; gap: 4px; padding: 16px; margin: 22px 0; background: #f1f4f0; border: 1px solid var(--auth-border); border-radius: 9px; font-size: 14px; }
.admin-mfa-status--active { background: #edf7f0; border-color: #afd6c5; }
.admin-mfa-status--pending { background: #fff8eb; border-color: #e4d1a8; }
.auth-form .admin-mfa-confirm-reset { grid-template-columns: 22px minmax(0, 1fr); align-items: start; min-height: 44px; padding: 8px 0; font-weight: 400; }
.admin-mfa-confirm-reset input { width: 20px; height: 20px; margin: 2px 0; accent-color: var(--auth-teal); }
.admin-mfa-recovery-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 24px 0; }
.admin-mfa-recovery-list li { min-width: 0; padding: 10px; background: #f2f5f0; border: 1px solid var(--auth-border); border-radius: 6px; text-align: center; }
.admin-mfa-recovery-list code { font-size: 13px; overflow-wrap: anywhere; user-select: all; }
.admin-mfa-back { margin-top: 20px; }

/* One connected workflow, readable even without its single <5s opacity/transform pass. */
.auth-pulse { --pulse-size: 48px; position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; isolation: isolate; overflow: hidden; }
.pulse-track { position: absolute; left: 12.5%; right: 12.5%; top: calc(var(--pulse-size) / 2); height: 1px; background: #568b7d; z-index: -1; }
.pulse-step { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pulse-step:not(:last-child)::after { content: ""; position: absolute; top: calc(var(--pulse-size) / 2 - 3px); right: -2px; width: 6px; height: 6px; border-top: 1px solid #7cac9c; border-right: 1px solid #7cac9c; transform: rotate(45deg); }
.pulse-label { color: #c3dcd5; font-size: 12px; font-weight: 600; line-height: 1.5; }
.pulse-step:last-child .pulse-label { color: var(--auth-mint); }
.pulse-node { width: 48px; height: 48px; display: grid; place-items: center; background: var(--auth-teal); border: 1px solid #7cac9c; border-radius: 12px; color: #bbd6cb; }
.pulse-node svg { width: 25px; height: 25px; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pulse-ready { background: var(--auth-mint); color: var(--auth-teal); border-color: var(--auth-mint); }
.pulse-traveller { position: absolute; inset: 0; z-index: -1; pointer-events: none; animation: pulse-journey 4.8s ease-in-out 1 both; }
.pulse-traveller::before { content: ""; position: absolute; width: 6px; height: 6px; top: calc(var(--pulse-size) / 2 - 3px); left: calc(12.5% - 3px); border-radius: 50%; background: #d8ffed; }
.pulse-operation { animation: pulse-receive 4.8s ease-out 1; }
.pulse-bay { animation: pulse-receive 4.8s .15s ease-out 1; }
@keyframes pulse-journey { 0%, 8% { transform: translateX(0); opacity: 0; } 13% { opacity: 1; } 85% { transform: translateX(75%); opacity: 1; } 100% { transform: translateX(75%); opacity: 0; } }
@keyframes pulse-receive { 0%, 15% { opacity: .55; } 55%, 100% { opacity: 1; } }
@media (max-width: 1100px) and (min-width: 901px) { .auth-frame { grid-template-columns: 40% minmax(0, 1fr); } .auth-card { padding: 44px 40px 32px; } .auth-identity { padding: 36px 30px; } }
@media (max-width: 900px) {
    .auth-page { padding: 32px 24px 20px; }
    .auth-frame { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
    .auth-identity { min-height: 0; flex-direction: row; align-items: center; padding: 28px 32px 0; gap: 28px; background: transparent; border-radius: 0; }
    .auth-wordmark { width: 128px; filter: none; flex-shrink: 0; }
    .auth-story, .auth-brand-line { display: none; }
    .auth-pulse { --pulse-size: 28px; max-width: 165px; }
    .pulse-step { gap: 4px; }
    .pulse-step::after { display: none; }
    .pulse-label, .pulse-step:last-child .pulse-label { color: #497366; font-size: 10px; }
    .pulse-node { width: 28px; height: 28px; border-radius: 7px; color: #497366; border-color: #bed7cb; background: white; }
    .pulse-node svg { width: 18px; height: 18px; }
    .pulse-ready { background: #cdf1de; color: var(--auth-teal); }
    .pulse-track { background: #bdd7cb; }
    .pulse-traveller::before { background: #247c64; }
    .auth-card { padding: 32px 32px 24px; }
}
@media (max-width: 480px) {
    .auth-page { justify-content: flex-start; padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
    .auth-frame { border-radius: 18px; }
    .auth-identity { padding: 24px 22px 0; gap: 22px; }
    .auth-wordmark { width: 112px; }
    .auth-card { padding: 28px 22px 18px; }
    .auth-pulse { --pulse-size: 24px; max-width: 156px; }
    .pulse-label, .pulse-step:last-child .pulse-label { font-size: 9.5px; }
    .pulse-node { width: 24px; height: 24px; }
    .pulse-node svg { width: 15px; height: 15px; }
    .auth-form { gap: 18px; margin-top: 24px; }
    .auth-legal { margin-top: 10px; padding-top: 16px; font-size: 11px; }
    .admin-mfa-recovery-list { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .bayleo-auth *, .bayleo-auth *::before, .bayleo-auth *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .pulse-traveller { display: none; }
}
@media (forced-colors: active) { .auth-identity, .pulse-node { border: 1px solid; } .auth-wordmark { filter: none; } .auth-submit { border: 2px solid ButtonText; } }
