:root {
    --auth-accent: #0f9488;
    --auth-accent-strong: #0b746c;
    --auth-accent-soft: color-mix(in srgb, var(--auth-accent) 12%, transparent);
    --auth-hero-start: #062f31;
    --auth-hero-end: #0a6963;
    --auth-hero-glow: #22c6b7;
    --auth-surface: color-mix(in srgb, var(--speas-surface, #ffffff) 96%, transparent);
    --auth-surface-soft: var(--speas-surface-2, #f5f8fc);
    --auth-line: var(--speas-border, #d8e3ef);
    --auth-text: var(--speas-text, #111827);
    --auth-muted: var(--speas-muted, #627189);
    --auth-danger: var(--speas-danger, #c2413b);
    --auth-success: var(--speas-success, #15803d);
    --auth-card-shadow: 0 28px 80px rgba(35, 48, 69, 0.14), 0 8px 24px rgba(35, 48, 69, 0.08);
}

.speas-auth-page[data-login-portal="contable"] {
    --auth-accent: #6968e4;
    --auth-accent-strong: #4f4fc2;
    --auth-hero-start: #151743;
    --auth-hero-end: #4542a4;
    --auth-hero-glow: #9897ff;
}

.speas-auth-page[data-login-portal="proveedores"] {
    --auth-accent: #2f76e8;
    --auth-accent-strong: #2359bd;
    --auth-hero-start: #082650;
    --auth-hero-end: #145eb0;
    --auth-hero-glow: #65a7ff;
}

.speas-auth-page[data-login-portal="recuperacion"] {
    --auth-accent: #0f766e;
    --auth-accent-strong: #0b5f59;
    --auth-hero-start: #0b3031;
    --auth-hero-end: #176a65;
    --auth-hero-glow: #56d8ca;
}

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

html { min-width: 320px; height: 100%; }

body.speas-auth-page {
    width: 100%;
    min-width: 320px;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    overflow: hidden;
    background: var(--auth-surface-soft);
    color: var(--auth-text);
    font-family: "Nunito", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden], .hidden, .speas-auth-page [hidden] { display: none; }

.auth-window, .auth-workspace { width: 100%; height: 100%; min-height: 0; }
.auth-window { overflow: hidden; }

.auth-workspace {
    display: grid;
    grid-template-columns: minmax(500px, 1.08fr) minmax(460px, 0.92fr);
}

.auth-sidebar {
    position: relative;
    isolation: isolate;
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    gap: clamp(18px, 2.4vh, 28px);
    overflow: hidden;
    padding: clamp(30px, 4vw, 58px) clamp(34px, 5.2vw, 78px);
    background:
        radial-gradient(circle at 82% 14%, color-mix(in srgb, var(--auth-hero-glow) 34%, transparent), transparent 34%),
        radial-gradient(circle at 12% 92%, rgba(255, 255, 255, 0.12), transparent 30%),
        linear-gradient(142deg, var(--auth-hero-start), var(--auth-hero-end));
    color: #ffffff;
}

.auth-sidebar::before, .auth-sidebar::after {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.auth-sidebar::before {
    width: min(62vw, 720px);
    height: min(62vw, 720px);
    top: -42%;
    right: -36%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 72px rgba(255, 255, 255, 0.025), 0 0 0 145px rgba(255, 255, 255, 0.018);
}

.auth-sidebar::after {
    width: 260px;
    height: 260px;
    bottom: -170px;
    left: -90px;
    background: color-mix(in srgb, var(--auth-hero-glow) 28%, transparent);
    filter: blur(18px);
}

.auth-brand-row {
    position: relative;
    z-index: 3;
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.auth-brand { display: flex; min-width: 0; align-items: center; gap: 13px; }

.auth-brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 15px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.1));
    color: #ffffff;
    font-size: 21px;
    font-weight: 900;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 14px 30px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(12px);
}

.auth-brand-copy { min-width: 0; }
.auth-brand-copy strong, .auth-brand-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-brand-copy strong { color: #ffffff; font-size: 17px; font-weight: 850; }
.auth-brand-copy span { margin-top: 1px; color: rgba(255, 255, 255, 0.66); font-size: 11px; font-weight: 650; }

.auth-theme-slot { display: flex; flex: 0 0 auto; justify-content: flex-end; }

.auth-theme-slot .speas-theme-switch {
    position: static;
    display: inline-flex;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(5, 17, 28, 0.18);
    box-shadow: none;
    backdrop-filter: blur(12px);
}

.auth-theme-slot .speas-theme-btn {
    width: 31px;
    height: 30px;
    min-width: 31px;
    min-height: 30px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: rgba(255, 255, 255, 0.68);
    cursor: pointer;
}

.auth-theme-slot .speas-theme-btn:hover, .auth-theme-slot .speas-theme-btn.active {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.auth-intro {
    position: relative;
    z-index: 2;
    display: grid;
    max-width: 610px;
    gap: 11px;
}

.auth-eyebrow {
    width: max-content;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--auth-accent) 30%, var(--auth-line));
    border-radius: 999px;
    background: var(--auth-accent-soft);
    color: var(--auth-accent-strong);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.auth-sidebar .auth-eyebrow { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.11); color: rgba(255,255,255,.88); }

.auth-intro h1 {
    max-width: 14ch;
    margin: 0;
    color: #ffffff;
    font-size: clamp(34px, 4.3vw, 64px);
    font-weight: 880;
    letter-spacing: -0.055em;
    line-height: .98;
    text-wrap: balance;
}

.auth-intro p { max-width: 55ch; margin: 0; color: rgba(255,255,255,.7); font-size: clamp(13px,1.15vw,16px); line-height: 1.55; }
.auth-sidebar-details { position: relative; z-index: 2; }

.auth-finder-list, .auth-trust-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.auth-finder-list { grid-template-columns: repeat(2, minmax(0,1fr)); }

.auth-finder-list li, .auth-trust-list li {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
    color: rgba(255,255,255,.68);
    font-size: 12px;
    font-weight: 700;
}

.auth-finder-list li {
    min-height: 42px;
    padding: 8px 11px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    background: rgba(8,20,34,.12);
    backdrop-filter: blur(8px);
}

.auth-finder-list li.is-active { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.14); color: #fff; }
.auth-finder-list i, .auth-trust-list i { flex: 0 0 auto; color: color-mix(in srgb,var(--auth-hero-glow) 72%,#fff); font-size: 17px; }

.auth-visual-stage {
    position: relative;
    z-index: 1;
    min-height: 168px;
    flex: 1 1 190px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 26px;
    background: linear-gradient(rgba(255,255,255,.045) 1px,transparent 1px), linear-gradient(90deg,rgba(255,255,255,.045) 1px,transparent 1px), rgba(6,18,32,.12);
    background-size: 28px 28px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.auth-orbit { position: absolute; top: 50%; left: 50%; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; transform: translate(-50%,-50%); }
.auth-orbit-one { width: 150px; height: 150px; animation: auth-breathe 4.6s ease-in-out infinite; }
.auth-orbit-two { width: 236px; height: 236px; border-style: dashed; animation: auth-rotate 24s linear infinite; }

.auth-core {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 70px;
    height: 70px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 24px;
    background: linear-gradient(145deg,rgba(255,255,255,.26),rgba(255,255,255,.09));
    color: #fff;
    font-size: 30px;
    box-shadow: 0 22px 50px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.3);
    transform: translate(-50%,-50%) rotate(-8deg);
    backdrop-filter: blur(10px);
}

.auth-insight-card {
    position: absolute;
    display: flex;
    min-width: 205px;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 15px;
    background: rgba(7,20,34,.42);
    color: #fff;
    box-shadow: 0 18px 42px rgba(0,0,0,.17);
    backdrop-filter: blur(16px);
}

.auth-insight-card.is-primary { top: 18px; right: 20px; animation: auth-float 5s ease-in-out infinite; }
.auth-insight-card.is-secondary { bottom: 18px; left: 20px; animation: auth-float 5s ease-in-out 1.2s infinite reverse; }
.auth-insight-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 10px; background: rgba(255,255,255,.13); color: color-mix(in srgb,var(--auth-hero-glow) 72%,#fff); font-size: 18px; }
.auth-insight-card small, .auth-insight-card strong { display: block; }
.auth-insight-card small { color: rgba(255,255,255,.58); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.auth-insight-card strong { margin-top: 2px; font-size: 12px; font-weight: 800; white-space: nowrap; }

.auth-live-dot {
    width: 8px;
    height: 8px;
    margin-left: auto;
    border: 2px solid rgba(255,255,255,.45);
    border-radius: 50%;
    background: #5ee6a8;
    animation: auth-pulse 2s ease-out infinite;
}

.auth-sidebar-footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.14);
}

.auth-sidebar-footer .auth-trust-list { display: flex; flex-wrap: wrap; gap: 9px 15px; }
.auth-sidebar-footer p { max-width: 250px; margin: 0; color: rgba(255,255,255,.5); font-size: 10px; line-height: 1.4; text-align: right; }

.auth-main {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    align-items: center;
    justify-items: center;
    padding: clamp(26px,5vw,76px);
    background: radial-gradient(circle at 86% 12%,var(--auth-accent-soft),transparent 32%), radial-gradient(circle at 14% 86%,color-mix(in srgb,var(--auth-accent) 7%,transparent),transparent 30%), var(--auth-surface-soft);
}

.auth-main::before { position: absolute; width: 190px; height: 190px; top: 7%; right: 7%; border: 1px solid color-mix(in srgb,var(--auth-accent) 13%,transparent); border-radius: 50%; box-shadow: 0 0 0 48px color-mix(in srgb,var(--auth-accent) 2.5%,transparent); content: ""; pointer-events: none; }

.auth-card {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(480px,100%);
    max-height: 100%;
    gap: clamp(15px,2.1vh,22px);
    padding: clamp(24px,3.6vw,44px);
    overflow: hidden;
    border: 1px solid color-mix(in srgb,var(--auth-line) 88%,transparent);
    border-radius: clamp(22px,2vw,30px);
    background: var(--auth-surface);
    box-shadow: var(--auth-card-shadow);
    backdrop-filter: blur(22px) saturate(125%);
    animation: auth-card-in 520ms cubic-bezier(.22,1,.36,1) both;
}

.auth-card::before { position: absolute; width: 86px; height: 4px; top: 0; left: 50%; border-radius: 0 0 999px 999px; background: linear-gradient(90deg,transparent,var(--auth-accent),transparent); content: ""; transform: translateX(-50%); }
.auth-card-header { display: grid; gap: 7px; }
.auth-card-header h2, .auth-card-header h3 { margin: 0; color: var(--auth-text); font-size: clamp(27px,3vw,36px); font-weight: 880; letter-spacing: -.045em; line-height: 1.06; }
.auth-card-header p { margin: 0; color: var(--auth-muted); font-size: 13px; line-height: 1.45; }
.auth-form, .auth-form-section { display: grid; gap: 14px; }
.auth-field { display: grid; gap: 6px; }
.auth-field > label, .auth-field-label { color: var(--auth-text); font-size: 11px; font-weight: 820; }
.auth-input { position: relative; display: flex; min-width: 0; align-items: center; }
.auth-input > i { position: absolute; left: 14px; z-index: 1; color: var(--auth-muted); font-size: 18px; pointer-events: none; }

.auth-input input, .auth-input select, .auth-textarea {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 10px 13px 10px 43px;
    border: 1px solid var(--auth-line);
    border-radius: 13px;
    outline: 0;
    background: var(--auth-surface-soft);
    color: var(--auth-text);
    font-size: 13px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

.auth-input input.has-action { padding-right: 46px; }
.auth-input input::placeholder, .auth-textarea::placeholder { color: color-mix(in srgb,var(--auth-muted) 76%,transparent); }
.auth-input input:focus, .auth-input select:focus, .auth-textarea:focus { border-color: var(--auth-accent); background: var(--auth-surface); box-shadow: 0 0 0 4px var(--auth-accent-soft); transform: translateY(-1px); }
.auth-input input:read-only { opacity: .72; cursor: not-allowed; }

.auth-input-action { position: absolute; right: 5px; display: grid; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--auth-muted); cursor: pointer; }
.auth-input-action:hover { background: var(--auth-accent-soft); color: var(--auth-accent); }
.auth-actions-row { display: flex; min-height: 18px; align-items: center; justify-content: flex-end; gap: 12px; }

.auth-link, .auth-footer a, .auth-quiet-button { border: 0; padding: 0; background: transparent; color: var(--auth-accent-strong); font-size: 11px; font-weight: 800; text-decoration: none; cursor: pointer; }
.auth-link:hover, .auth-footer a:hover, .auth-quiet-button:hover { text-decoration: underline; }

.auth-primary, .auth-secondary, .auth-inline-button { display: inline-flex; min-height: 47px; align-items: center; justify-content: center; gap: 9px; border-radius: 13px; font-weight: 850; cursor: pointer; transition: transform 150ms ease,box-shadow 150ms ease,filter 150ms ease; }

.auth-primary { position: relative; width: 100%; overflow: hidden; padding: 10px 16px; border: 1px solid color-mix(in srgb,var(--auth-accent-strong) 72%,transparent); background: linear-gradient(135deg,color-mix(in srgb,var(--auth-accent) 92%,#fff),var(--auth-accent-strong)); color: #fff; box-shadow: 0 12px 24px color-mix(in srgb,var(--auth-accent) 24%,transparent); }
.auth-primary::before { position: absolute; width: 44%; height: 180%; top: -40%; left: -55%; background: linear-gradient(90deg,transparent,rgba(255,255,255,.2),transparent); content: ""; transform: rotate(18deg); transition: left 520ms ease; }
.auth-primary:hover::before { left: 120%; }
.auth-secondary, .auth-inline-button { padding: 9px 14px; border: 1px solid var(--auth-line); background: var(--auth-surface); color: var(--auth-text); }
.auth-inline-button { min-height: 43px; font-size: 11px; white-space: nowrap; }
.auth-primary:hover, .auth-secondary:hover, .auth-inline-button:hover { filter: brightness(1.035); transform: translateY(-1px); }
.auth-primary:disabled, .auth-secondary:disabled, .auth-inline-button:disabled { opacity: .58; cursor: wait; filter: none; transform: none; }

.auth-spinner { display: none; width: 17px; height: 17px; flex: 0 0 17px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: auth-spin 700ms linear infinite; }
.auth-primary.loading .auth-spinner, .auth-primary[aria-busy="true"] .auth-spinner { display: inline-block; }
.auth-primary.loading > i, .auth-primary[aria-busy="true"] > i { display: none; }

.auth-message { display: none; min-height: 42px; align-items: flex-start; gap: 9px; padding: 10px 12px; border: 1px solid var(--auth-line); border-radius: 11px; background: var(--auth-surface-soft); color: var(--auth-muted); font-size: 12px; line-height: 1.4; }
.auth-message.show, .auth-message.is-visible { display: flex; }
.auth-message.error { border-color: color-mix(in srgb,var(--auth-danger) 34%,var(--auth-line)); background: color-mix(in srgb,var(--auth-danger) 9%,var(--auth-surface)); color: var(--auth-danger); }
.auth-message.info, .auth-message.success { border-color: color-mix(in srgb,var(--auth-accent) 30%,var(--auth-line)); background: var(--auth-accent-soft); color: var(--auth-accent-strong); }

.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--auth-muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--auth-line); content: ""; }
.auth-register-box { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--auth-line); border-radius: 13px; background: var(--auth-surface-soft); text-align: center; }
.auth-register-box p { margin: 0; color: var(--auth-muted); font-size: 11px; }
.auth-register-box .auth-secondary { min-height: 42px; }

.auth-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; color: var(--auth-muted); font-size: 10px; text-align: center; }
.auth-security-note { display: flex; align-items: flex-start; gap: 8px; padding-top: 13px; border-top: 1px solid var(--auth-line); color: var(--auth-muted); font-size: 10px; line-height: 1.4; }
.auth-security-note i { flex: 0 0 auto; color: var(--auth-accent); font-size: 16px; }
.auth-security-note p { margin: 0; }
.auth-mfa { display: none; }
.auth-mfa.show { display: grid; animation: auth-reveal 180ms ease-out; }

body.speas-auth-page.is-leaving .auth-window { opacity: 0; transform: scale(.992); transition: opacity 180ms ease,transform 180ms ease; }
body.speas-auth-page[data-modal-open="true"] { overflow: hidden; }

.auth-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.auth-modal { position: fixed; z-index: 12000; inset: 0; display: grid; overflow-y: auto; padding: 24px; place-items: center; background: rgba(15,23,42,.62); backdrop-filter: blur(8px); }
.auth-modal[hidden], .auth-modal.hidden { display: none; }
.auth-modal-card { width: min(660px,100%); max-height: min(860px,calc(100dvh - 48px)); overflow-y: auto; border: 1px solid var(--auth-line); border-radius: 22px; background: var(--auth-surface); color: var(--auth-text); box-shadow: 0 32px 100px rgba(15,23,42,.36); }
.auth-modal-card.is-compact { width: min(500px,100%); }
.auth-modal-header { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 20px; border-bottom: 1px solid var(--auth-line); background: color-mix(in srgb,var(--auth-surface) 94%,transparent); backdrop-filter: blur(14px); }
.auth-modal-header h3 { margin: 0; font-size: 18px; font-weight: 850; }
.auth-modal-close { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border: 1px solid var(--auth-line); border-radius: 11px; background: var(--auth-surface-soft); color: var(--auth-muted); cursor: pointer; }
.auth-modal-close:hover { color: var(--auth-danger); }
.auth-modal-body { display: grid; gap: 17px; padding: 20px; }
.auth-modal-intro, .auth-section-note { margin: 0; color: var(--auth-muted); font-size: 12px; line-height: 1.5; }
.auth-section-title { margin: 2px 0 -4px; color: var(--auth-accent-strong); font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.auth-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.auth-form-grid .is-wide { grid-column: 1 / -1; }
.auth-inline-field { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
.auth-otp-box { display: grid; gap: 9px; padding: 12px; border: 1px solid var(--auth-line); border-radius: 12px; background: var(--auth-surface-soft); }

.auth-toast-container { position: fixed; z-index: 13000; top: 18px; right: 18px; display: grid; width: min(380px,calc(100vw - 36px)); gap: 10px; }
.auth-toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border: 1px solid var(--auth-line); border-radius: 13px; background: var(--auth-surface); color: var(--auth-text); font-size: 12px; line-height: 1.4; box-shadow: 0 14px 34px rgba(15,23,42,.17); animation: auth-toast-in 180ms ease-out; }
.auth-toast.success { border-left: 4px solid var(--auth-success); }
.auth-toast.error { border-left: 4px solid var(--auth-danger); }
.auth-toast.success i { color: var(--auth-success); }
.auth-toast.error i { color: var(--auth-danger); }
.auth-toast.is-leaving { opacity: 0; transform: translateX(16px); transition: opacity 180ms ease,transform 180ms ease; }

:is(.auth-primary,.auth-secondary,.auth-inline-button,.auth-input-action,.auth-modal-close,.auth-link,.auth-footer a,.auth-quiet-button,.speas-theme-btn):focus-visible,
.auth-input input:focus-visible, .auth-input select:focus-visible { outline: 2px solid var(--auth-accent); outline-offset: 2px; }

@keyframes auth-spin { to { transform: rotate(360deg); } }
@keyframes auth-reveal { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes auth-toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes auth-card-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes auth-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes auth-breathe { 0%,100% { opacity: .56; transform: translate(-50%,-50%) scale(.96); } 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.04); } }
@keyframes auth-rotate { from { transform: translate(-50%,-50%) rotate(0); } to { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes auth-pulse { 0% { box-shadow: 0 0 0 0 rgba(94,230,168,.55); } 70%,100% { box-shadow: 0 0 0 8px rgba(94,230,168,0); } }

@media (max-width: 1100px) {
    .auth-workspace { grid-template-columns: minmax(420px,.95fr) minmax(420px,1.05fr); }
    .auth-sidebar { padding-inline: clamp(30px,4vw,52px); }
    .auth-intro h1 { font-size: clamp(34px,4.8vw,50px); }
    .auth-sidebar-footer p { display: none; }
}

@media (max-width: 820px) {
    .auth-workspace { grid-template-columns: 1fr; grid-template-rows: auto minmax(0,1fr); }
    .auth-sidebar { gap: 12px; padding: 18px clamp(18px,6vw,38px) 16px; border-radius: 0 0 26px 26px; box-shadow: 0 14px 40px color-mix(in srgb,var(--auth-hero-start) 24%,transparent); }
    .auth-sidebar::before { width: 420px; height: 420px; top: -270px; right: -170px; }
    .auth-brand-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 13px; font-size: 19px; }
    .auth-intro { gap: 6px; }
    .auth-intro .auth-eyebrow, .auth-sidebar-details, .auth-visual-stage, .auth-sidebar-footer { display: none; }
    .auth-intro h1 { max-width: 20ch; font-size: clamp(22px,6.2vw,31px); line-height: 1.03; }
    .auth-intro p { max-width: 68ch; font-size: 12px; line-height: 1.4; }
    .auth-main { align-items: center; padding: clamp(12px,3.8vh,28px) clamp(14px,6vw,38px); }
    .auth-card { width: min(500px,100%); gap: clamp(11px,2vh,17px); padding: clamp(18px,4.8vw,28px); border-radius: 22px; }
    .auth-card-header h2, .auth-card-header h3 { font-size: clamp(24px,6.5vw,30px); }
    body.speas-auth-page:has(.auth-input input:focus) .auth-main { overflow-y: auto; }
}

@media (max-width: 520px) {
    .auth-sidebar { padding: 14px 16px 13px; }
    .auth-brand { gap: 10px; }
    .auth-brand-copy strong { font-size: 15px; }
    .auth-brand-copy span { font-size: 10px; }
    .auth-theme-slot .speas-theme-btn { width: 28px; min-width: 28px; height: 28px; min-height: 28px; }
    .auth-intro h1 { font-size: clamp(20px,6.5vw,26px); }
    .auth-intro p { font-size: 11px; }
    .auth-main { padding: 12px; }
    .auth-card { padding: 18px; }
    .auth-form-grid { grid-template-columns: 1fr; }
    .auth-form-grid .is-wide { grid-column: auto; }
    .auth-inline-field { grid-template-columns: 1fr; }
    .auth-inline-button { width: 100%; }
    .auth-modal { padding: 8px; place-items: end center; }
    .auth-modal-card, .auth-modal-card.is-compact { max-height: calc(100dvh - 16px); border-radius: 19px; }
    .auth-toast-container { top: 10px; right: 10px; width: calc(100vw - 20px); }
}

@media (max-width: 820px) and (max-height: 740px) {
    .auth-sidebar { gap: 7px; padding-top: 10px; padding-bottom: 9px; border-radius: 0 0 20px 20px; }
    .auth-brand-mark { width: 35px; height: 35px; flex-basis: 35px; border-radius: 11px; font-size: 17px; }
    .auth-intro p { display: none; }
    .auth-intro h1 { font-size: clamp(18px,5.8vw,23px); }
    .auth-main { padding: 8px 11px; }
    .auth-card { gap: 9px; padding: 14px 16px; border-radius: 18px; }
    .auth-card-header { gap: 4px; }
    .auth-card-header h2, .auth-card-header h3 { font-size: 22px; }
    .auth-card-header p { font-size: 11px; }
    .auth-form, .auth-form-section { gap: 9px; }
    .auth-field { gap: 4px; }
    .auth-input input, .auth-input select, .auth-textarea { min-height: 42px; padding-top: 7px; padding-bottom: 7px; }
    .auth-primary, .auth-secondary { min-height: 42px; }
    .auth-security-note, .auth-footer { display: none; }
    .auth-divider { gap: 7px; }
    .auth-register-box { padding: 8px; }
    .auth-register-box p { display: none; }
    .auth-register-box .auth-secondary { min-height: 38px; }
}

@media (min-width: 821px) and (max-height: 760px) {
    .auth-sidebar { gap: 14px; padding-top: 24px; padding-bottom: 24px; }
    .auth-intro h1 { font-size: clamp(32px,4vw,48px); }
    .auth-intro p { font-size: 12px; }
    .auth-visual-stage { min-height: 128px; flex-basis: 140px; }
    .auth-sidebar-footer { display: none; }
    .auth-main { padding-block: 18px; }
    .auth-card { gap: 12px; padding-block: 24px; }
    .auth-security-note { padding-top: 10px; }
}

@media (min-width: 1800px) {
    .auth-workspace { grid-template-columns: minmax(740px,1.12fr) minmax(620px,.88fr); }
    .auth-card { width: min(520px,100%); }
    .auth-intro h1 { font-size: clamp(56px,4vw,72px); }
}

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

/* SPEAS v6 — acceso claro, corporativo y compartido entre portales. */
body.speas-auth-page {
    --auth-brand-panel: #fbfcfe;
    --auth-brand-panel-soft: #f4f7fb;
    --auth-brand-grid: color-mix(in srgb, var(--auth-accent) 7%, transparent);
}

body.speas-auth-page .auth-sidebar {
    border-right: 1px solid var(--auth-line);
    background:
        radial-gradient(circle at 84% 9%, color-mix(in srgb, var(--auth-accent) 10%, transparent), transparent 27%),
        radial-gradient(circle at 5% 95%, color-mix(in srgb, var(--auth-accent) 6%, transparent), transparent 23%),
        linear-gradient(var(--auth-brand-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--auth-brand-grid) 1px, transparent 1px),
        var(--auth-brand-panel);
    background-size: auto, auto, 34px 34px, 34px 34px, auto;
    color: var(--auth-text);
}

body.speas-auth-page .auth-sidebar::before {
    width: 360px;
    height: 360px;
    top: -190px;
    right: -120px;
    border: 1px solid color-mix(in srgb, var(--auth-accent) 13%, transparent);
    background: color-mix(in srgb, var(--auth-accent) 3.5%, transparent);
    box-shadow: 0 0 0 54px color-mix(in srgb, var(--auth-accent) 2%, transparent);
}

body.speas-auth-page .auth-sidebar::after {
    width: 240px;
    height: 110px;
    bottom: -54px;
    left: -62px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--auth-accent) 9%, transparent);
    filter: blur(2px);
    transform: rotate(-16deg);
}

body.speas-auth-page .auth-brand-mark {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    overflow: hidden;
    border: 0;
    border-radius: 15px;
    background: transparent;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--auth-accent) 21%, transparent);
    backdrop-filter: none;
}

body.speas-auth-page .auth-brand-mark img { width: 100%; height: 100%; display: block; }
body.speas-auth-page .auth-brand-copy strong { color: var(--auth-text); font-size: 18px; letter-spacing: .05em; }
body.speas-auth-page .auth-brand-copy span { color: var(--auth-muted); font-size: 10px; letter-spacing: .025em; }
body.speas-auth-page .auth-sidebar .auth-eyebrow { border-color: color-mix(in srgb,var(--auth-accent) 24%,var(--auth-line)); background: var(--auth-accent-soft); color: var(--auth-accent-strong); }
body.speas-auth-page .auth-intro h1 { max-width: 15ch; color: var(--auth-text); font-size: clamp(35px,3.8vw,58px); line-height: 1.01; }
body.speas-auth-page .auth-intro p { color: var(--auth-muted); }

body.speas-auth-page .auth-visual-stage {
    min-height: 205px;
    border-color: var(--auth-line);
    background:
        linear-gradient(color-mix(in srgb,var(--auth-accent) 7%,transparent) 1px, transparent 1px),
        linear-gradient(90deg,color-mix(in srgb,var(--auth-accent) 7%,transparent) 1px,transparent 1px),
        color-mix(in srgb,var(--auth-surface) 96%,var(--auth-accent-soft));
    background-size: 28px 28px;
    box-shadow: inset 0 1px 0 #fff, 0 18px 45px rgba(38,52,74,.06);
}

body.speas-auth-page .auth-orbit { border-color: color-mix(in srgb,var(--auth-accent) 23%,transparent); }
body.speas-auth-page .auth-core { display: none; }
body.speas-auth-page .auth-insight-card {
    min-width: 196px;
    border-color: color-mix(in srgb,var(--auth-accent) 16%,var(--auth-line));
    background: color-mix(in srgb,var(--auth-surface) 95%,transparent);
    color: var(--auth-text);
    box-shadow: 0 14px 34px rgba(38,52,74,.11);
}
body.speas-auth-page .auth-insight-icon { background: var(--auth-accent-soft); color: var(--auth-accent); }
body.speas-auth-page .auth-insight-card small { color: var(--auth-muted); }
body.speas-auth-page .auth-insight-card strong { color: var(--auth-text); }
body.speas-auth-page .auth-live-dot { border-color: #fff; }
body.speas-auth-page .auth-finder-list li {
    border-color: var(--auth-line);
    background: color-mix(in srgb,var(--auth-surface) 93%,transparent);
    color: var(--auth-muted);
    box-shadow: 0 7px 18px rgba(38,52,74,.035);
}
body.speas-auth-page .auth-finder-list li.is-active { border-color: color-mix(in srgb,var(--auth-accent) 26%,var(--auth-line)); background: var(--auth-accent-soft); color: var(--auth-accent-strong); }
body.speas-auth-page .auth-finder-list i, body.speas-auth-page .auth-trust-list i { color: var(--auth-accent); }
body.speas-auth-page .auth-trust-list li { color: var(--auth-muted); }
body.speas-auth-page .auth-sidebar-footer { border-top-color: var(--auth-line); }
body.speas-auth-page .auth-sidebar-footer p { color: var(--auth-muted); }
body.speas-auth-page .auth-main { background: radial-gradient(circle at 88% 10%,var(--auth-accent-soft),transparent 31%), radial-gradient(circle at 14% 88%,color-mix(in srgb,var(--auth-accent) 5%,transparent),transparent 30%), #f4f7fb; }

/* Asistente vectorial SPEAS: ligero, reactivo y sin librerías de animación. */
.speas-assistant {
    --assistant-eye-x: 0px;
    --assistant-eye-y: 0px;
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    width: 122px;
    height: 145px;
    transform: translate(-50%,-42%);
    pointer-events: none;
}

.speas-assistant-unit { position: absolute; width: 92px; height: 116px; left: 15px; bottom: 7px; animation: speas-assistant-walk 1.2s ease-in-out infinite; }
.speas-assistant-shadow { position: absolute; width: 72px; height: 12px; left: 25px; bottom: 1px; border-radius: 50%; background: rgba(44,57,78,.12); filter: blur(3px); animation: speas-assistant-shadow 1.2s ease-in-out infinite; }
.speas-assistant-antenna { position: absolute; z-index: 0; width: 3px; height: 15px; top: -10px; left: 45px; border-radius: 4px; background: #5d6b7e; }
.speas-assistant-antenna i { position: absolute; width: 8px; height: 8px; top: -5px; left: -2.5px; border-radius: 50%; background: var(--auth-accent); box-shadow: 0 0 0 4px var(--auth-accent-soft); animation: auth-pulse 2s ease-out infinite; }
.speas-assistant-head { position: absolute; z-index: 4; width: 78px; height: 58px; top: 3px; left: 7px; border: 1px solid #cbd6e3; border-radius: 24px 24px 20px 20px; background: linear-gradient(150deg,#fff,#edf3f9); box-shadow: 0 10px 23px rgba(46,59,79,.15), inset 0 1px 0 #fff; }
.speas-assistant-face { position: absolute; inset: 9px 10px 10px; border-radius: 16px; background: linear-gradient(145deg,#182838,#263b4e); box-shadow: inset 0 1px 2px rgba(255,255,255,.12); }
.speas-assistant-ear { position: absolute; z-index: -1; width: 10px; height: 25px; top: 17px; border: 1px solid #c5d2df; background: #e7eef6; }
.speas-assistant-ear.is-left { left: -7px; border-radius: 8px 2px 2px 8px; }
.speas-assistant-ear.is-right { right: -7px; border-radius: 2px 8px 8px 2px; }
.speas-assistant-eye { position: absolute; width: 15px; height: 12px; top: 10px; border-radius: 8px; background: #eafcff; box-shadow: 0 0 10px color-mix(in srgb,var(--auth-accent) 46%,transparent); }
.speas-assistant-eye.is-left { left: 9px; }
.speas-assistant-eye.is-right { right: 9px; }
.speas-assistant-eye i { position: absolute; width: 5px; height: 5px; top: 3.5px; left: 5px; border-radius: 50%; background: var(--auth-accent); transform: translate(var(--assistant-eye-x),var(--assistant-eye-y)); transition: transform 80ms linear; }
.speas-assistant-mouth { position: absolute; width: 18px; height: 6px; bottom: 6px; left: 20px; border-bottom: 2px solid #8bdacb; border-radius: 0 0 14px 14px; }
.speas-assistant-body { position: absolute; z-index: 2; width: 55px; height: 52px; top: 57px; left: 18px; border: 1px solid #c9d5e1; border-radius: 18px 18px 16px 16px; background: linear-gradient(145deg,#fff,#e9f0f7); box-shadow: 0 12px 24px rgba(46,59,79,.14); }
.speas-assistant-body img { position: absolute; width: 25px; height: 25px; top: 11px; left: 14px; border-radius: 8px; }
.speas-assistant-status { position: absolute; width: 6px; height: 6px; right: 6px; bottom: 7px; border-radius: 50%; background: #3bc48d; box-shadow: 0 0 0 3px #dff8ee; }
.speas-assistant-arm { position: absolute; z-index: 3; width: 13px; height: 48px; top: 57px; transform-origin: 50% 7px; transition: top 240ms ease, left 240ms ease, right 240ms ease, transform 260ms ease; }
.speas-assistant-arm::before { position: absolute; width: 10px; height: 32px; top: 0; left: 1px; border: 1px solid #c7d4e0; border-radius: 10px; background: linear-gradient(#f8fbff,#dfe8f1); content: ""; }
.speas-assistant-arm i { position: absolute; width: 13px; height: 13px; bottom: 2px; left: 0; border: 1px solid #bdcbd9; border-radius: 50%; background: #f6faff; }
.speas-assistant-arm.is-left { left: 10px; transform: rotate(11deg); }
.speas-assistant-arm.is-right { right: 10px; transform: rotate(-11deg); }
.speas-assistant-leg { position: absolute; z-index: 1; width: 17px; height: 30px; top: 98px; transform-origin: 50% 2px; }
.speas-assistant-leg::before { position: absolute; width: 12px; height: 23px; top: 0; left: 2px; border-radius: 8px; background: #dce6f0; border: 1px solid #c5d2df; content: ""; }
.speas-assistant-leg i { position: absolute; width: 21px; height: 9px; bottom: 0; border-radius: 8px 8px 6px 6px; background: #64748b; }
.speas-assistant-leg.is-left { left: 24px; animation: speas-assistant-leg-left 1.2s ease-in-out infinite; }
.speas-assistant-leg.is-right { right: 24px; animation: speas-assistant-leg-right 1.2s ease-in-out infinite; }
.speas-assistant-bubble { position: absolute; z-index: 7; min-width: 190px; max-width: 230px; left: 82px; top: -23px; padding: 9px 12px; border: 1px solid var(--auth-line); border-radius: 13px 13px 13px 5px; background: rgba(255,255,255,.96); color: var(--auth-text); font-size: 10px; font-weight: 800; line-height: 1.35; box-shadow: 0 12px 28px rgba(38,52,74,.11); }
.speas-assistant-bubble::before { position: absolute; width: 9px; height: 9px; left: -5px; bottom: 7px; border-left: 1px solid var(--auth-line); border-bottom: 1px solid var(--auth-line); background: #fff; content: ""; transform: rotate(45deg); }
.speas-assistant-bubble span { display: block; }
.speas-assistant-bubble span.is-changing { animation: speas-assistant-copy 420ms ease-out; }

body.assistant-is-shy .speas-assistant-arm.is-left { left: 22px; top: 32px; transform: rotate(-23deg); }
body.assistant-is-shy .speas-assistant-arm.is-right { right: 22px; top: 32px; transform: rotate(23deg); }
body.assistant-is-shy .speas-assistant-arm i { background: var(--auth-accent-soft); }
body.assistant-is-shy .speas-assistant-eye i { opacity: 0; }
body.assistant-is-shy .speas-assistant-mouth { width: 12px; left: 23px; border-radius: 50%; }
body[data-assistant-state="busy"] .speas-assistant-status { background: #f59e0b; box-shadow: 0 0 0 3px #fff1c9; animation: auth-pulse 1.1s ease-out infinite; }
body[data-assistant-state="success"] .speas-assistant-unit { animation: speas-assistant-success 620ms ease-out 2; }

.speas-assistant-mini { display: none; position: relative; width: 40px; height: 34px; flex: 0 0 40px; border: 1px solid rgba(255,255,255,.27); border-radius: 13px; background: rgba(255,255,255,.14); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.speas-assistant-mini-face { position: absolute; inset: 6px 5px; border-radius: 8px; background: #203447; }
.speas-assistant-mini-face i { position: absolute; width: 7px; height: 7px; top: 7px; border-radius: 50%; background: #dffaf6; }
.speas-assistant-mini-face i.is-left { left: 6px; }
.speas-assistant-mini-face i.is-right { right: 6px; }
.speas-assistant-mini-hand { position: absolute; z-index: 2; width: 9px; height: 13px; top: 13px; border: 1px solid #c4d1dd; border-radius: 7px; background: #f4f8fc; opacity: 0; transition: transform 220ms ease,opacity 180ms ease; }
.speas-assistant-mini-hand.is-left { left: 7px; }
.speas-assistant-mini-hand.is-right { right: 7px; }
body.assistant-is-shy .speas-assistant-mini-hand { opacity: 1; transform: translateY(-3px); }

@keyframes speas-assistant-walk { 0%,100% { transform: translateY(0) rotate(-.7deg); } 50% { transform: translateY(-3px) rotate(.7deg); } }
@keyframes speas-assistant-shadow { 0%,100% { opacity: .55; transform: scaleX(1); } 50% { opacity: .35; transform: scaleX(.82); } }
@keyframes speas-assistant-leg-left { 0%,100% { transform: rotate(8deg); } 50% { transform: rotate(-8deg); } }
@keyframes speas-assistant-leg-right { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes speas-assistant-copy { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes speas-assistant-success { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-10px); } }

/* ERP: pulso operativo y guía humana. El resto de portales conserva su escena. */
body[data-login-portal="erp"] .auth-visual-stage {
    min-height: 230px;
    background:
        linear-gradient(color-mix(in srgb,var(--auth-accent) 6%,transparent) 1px,transparent 1px),
        linear-gradient(90deg,color-mix(in srgb,var(--auth-accent) 6%,transparent) 1px,transparent 1px),
        radial-gradient(circle at 10% 94%,color-mix(in srgb,var(--auth-accent) 12%,transparent),transparent 34%),
        color-mix(in srgb,var(--auth-surface) 97%,var(--auth-accent-soft));
    background-size: 28px 28px,28px 28px,auto,auto;
}

.auth-operation-board {
    position: absolute;
    z-index: 2;
    width: min(56%, 365px);
    max-height: calc(100% - 30px);
    top: 50%;
    right: clamp(15px,2.4vw,28px);
    display: grid;
    gap: 10px;
    padding: 15px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb,var(--auth-accent) 13%,var(--auth-line));
    border-radius: 20px;
    background: color-mix(in srgb,var(--auth-surface) 97%,transparent);
    box-shadow: 0 22px 55px rgba(38,52,74,.1),inset 0 1px 0 #fff;
    transform: translateY(-50%);
    backdrop-filter: blur(16px);
}

.auth-operation-board-head,.auth-operation-board-head > span,.auth-operation-metric > span {
    display: flex;
    align-items: center;
}

.auth-operation-board-head { justify-content: space-between; gap: 12px; }
.auth-operation-board-head > span:first-child { display: grid; gap: 1px; }
.auth-operation-board-head small { color: var(--auth-muted); font-size: 8px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.auth-operation-board-head strong { color: var(--auth-text); font-size: 14px; font-weight: 900; }
.auth-operation-online { gap: 5px; padding: 4px 8px; border-radius: 999px; background: #eaf8f2; color: #13745a; font-size: 8px; font-weight: 900; }
.auth-operation-online i { width: 6px; height: 6px; border-radius: 50%; background: #2fb985; box-shadow: 0 0 0 3px rgba(47,185,133,.12); }

.auth-operation-metric { display: grid; gap: 7px; padding: 10px 11px; border: 1px solid var(--auth-line); border-radius: 13px; background: var(--auth-surface-soft); }
.auth-operation-metric > span { justify-content: space-between; gap: 12px; color: var(--auth-muted); font-size: 9px; }
.auth-operation-metric > span strong { font-weight: 800; }
.auth-operation-metric > span b { color: var(--auth-accent-strong); font-size: 10px; }
.auth-operation-metric > i { height: 5px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb,var(--auth-line) 72%,#fff); }
.auth-operation-metric > i em { display: block; width: 84%; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--auth-accent),color-mix(in srgb,var(--auth-accent) 70%,#62c9b2)); animation: auth-operation-progress 900ms cubic-bezier(.22,1,.36,1) both; }

.auth-operation-events { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.auth-operation-events li { display: flex; min-width: 0; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid color-mix(in srgb,var(--auth-line) 78%,transparent); border-radius: 11px; background: color-mix(in srgb,var(--auth-surface) 96%,transparent); }
.auth-operation-events > li > i { display: grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; border-radius: 50%; background: var(--auth-accent-soft); color: var(--auth-accent); font-size: 14px; font-weight: 900; }
.auth-operation-events span { display: grid; min-width: 0; gap: 1px; }
.auth-operation-events strong,.auth-operation-events small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-operation-events strong { color: var(--auth-text); font-size: 9px; font-weight: 850; }
.auth-operation-events small { color: var(--auth-muted); font-size: 7.5px; }

.speas-assistant-person {
    width: min(43%,210px);
    height: calc(100% - 14px);
    top: auto;
    bottom: 0;
    left: 3%;
    transform: none;
}

.speas-person-figure { position: absolute; z-index: 3; inset: 12px 0 0; transform-origin: 50% 100%; animation: speas-person-breathe 4.8s ease-in-out infinite; }
.speas-person-figure > img { width: 100%; height: 100%; display: block; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 16px 18px rgba(36,52,72,.12)); }
.speas-person-shadow { position: absolute; z-index: 1; width: 58%; height: 10px; left: 21%; bottom: 5px; border-radius: 50%; background: rgba(48,63,83,.12); filter: blur(5px); }
.speas-person-status { position: absolute; z-index: 6; left: 6px; bottom: 10px; display: flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid color-mix(in srgb,var(--auth-accent) 18%,var(--auth-line)); border-radius: 999px; background: rgba(255,255,255,.94); color: var(--auth-muted); font-size: 7.5px; font-weight: 850; box-shadow: 0 8px 20px rgba(38,52,74,.09); }
.speas-person-status i { width: 6px; height: 6px; border-radius: 50%; background: #32b985; box-shadow: 0 0 0 3px rgba(50,185,133,.12); }
.speas-person-privacy { position: absolute; z-index: 8; width: 92px; top: 31%; left: 50%; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 6px 7px; border: 1px solid color-mix(in srgb,var(--auth-accent) 30%,var(--auth-line)); border-radius: 9px; background: rgba(255,255,255,.97); color: var(--auth-accent-strong); font-size: 7px; box-shadow: 0 8px 20px rgba(24,39,58,.14); opacity: 0; transform: translate(-50%,8px) scale(.92); transition: opacity 180ms ease,transform 220ms cubic-bezier(.22,1,.36,1); }
.speas-person-privacy i { font-size: 10px; }
.speas-person-privacy b { white-space: nowrap; }

.speas-assistant-person .speas-assistant-bubble { min-width: 155px; max-width: 185px; top: 11px; left: 72%; border-radius: 13px 13px 13px 5px; }
body.assistant-is-shy .speas-assistant-person .speas-person-privacy { opacity: 1; transform: translate(-50%,0) scale(1); }
body.assistant-is-shy .speas-assistant-person .speas-person-figure { animation-play-state: paused; }
body[data-assistant-state="busy"] .speas-assistant-person .speas-person-status i { background: #eaa21f; box-shadow: 0 0 0 3px rgba(234,162,31,.15); animation: auth-pulse 1.1s ease-out infinite; }
body[data-assistant-state="success"] .speas-assistant-person .speas-person-figure { animation: speas-person-success 620ms ease-out 2; }

.speas-assistant-mini-person { overflow: hidden; border-color: color-mix(in srgb,var(--auth-accent) 25%,var(--auth-line)); background: #fff; box-shadow: 0 8px 18px rgba(22,48,68,.12); }
.speas-assistant-mini-person img { position: absolute; width: 43px; height: 65px; top: -2px; left: 50%; object-fit: contain; object-position: center top; transform: translateX(-50%); }
.speas-assistant-mini-person > i { position: absolute; z-index: 2; width: 7px; height: 7px; right: 3px; bottom: 3px; border: 2px solid #fff; border-radius: 50%; background: #32b985; }

@keyframes auth-operation-progress { from { width: 0; } to { width: 84%; } }
@keyframes speas-person-breathe { 0%,100% { transform: translateY(0) rotate(-.3deg); } 50% { transform: translateY(-3px) rotate(.3deg); } }
@keyframes speas-person-success { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-8px); } }

@media (max-width: 1100px) and (min-width: 821px) {
    .speas-assistant { transform: translate(-55%,-40%) scale(.9); }
    .speas-assistant-bubble { min-width: 158px; max-width: 174px; left: 72px; font-size: 9px; }
    body.speas-auth-page .auth-insight-card { min-width: 170px; }
    .speas-assistant-person { width: 41%; left: 1%; transform: none; }
    .speas-assistant-person .speas-assistant-bubble { min-width: 126px; max-width: 138px; left: 4px; }
    .auth-operation-board { width: 57%; right: 12px; padding: 12px; }
}

@media (max-width: 820px) {
    /* En móvil conservamos el encabezado compacto que ya funcionaba bien. */
    body.speas-auth-page .auth-sidebar {
        border-right: 0;
        border-bottom: 1px solid rgba(255,255,255,.16);
        background:
            radial-gradient(circle at 88% -15%,color-mix(in srgb,var(--auth-hero-glow) 33%,transparent),transparent 45%),
            linear-gradient(142deg,var(--auth-hero-start),var(--auth-hero-end));
        color: #fff;
    }
    body.speas-auth-page .auth-sidebar::before { border-color: rgba(255,255,255,.11); background: transparent; box-shadow: 0 0 0 54px rgba(255,255,255,.025); }
    body.speas-auth-page .auth-brand-copy strong, body.speas-auth-page .auth-intro h1 { color: #fff; }
    body.speas-auth-page .auth-brand-copy span, body.speas-auth-page .auth-intro p { color: rgba(255,255,255,.7); }
    body.speas-auth-page .auth-brand-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 13px; box-shadow: 0 10px 24px rgba(0,0,0,.16); }
    .speas-assistant-mini { display: block; margin-left: auto; animation: speas-assistant-walk 1.5s ease-in-out infinite; }
}

@media (prefers-reduced-motion: reduce) {
    .speas-assistant-unit, .speas-assistant-shadow, .speas-assistant-leg, .speas-assistant-mini { animation: none !important; }
    .speas-assistant-bubble span { animation: none !important; }
    .speas-person-figure,.auth-operation-metric > i em { animation: none !important; }
}

@media (min-width: 821px) and (max-height: 760px) {
    body[data-login-portal="erp"] .auth-visual-stage { min-height: 145px; }
    .auth-operation-board { gap: 6px; padding: 10px; }
    .auth-operation-metric { padding: 7px 9px; }
    .auth-operation-events { gap: 4px; }
    .auth-operation-events li { padding: 5px 7px; }
    .auth-operation-events li:nth-child(3) { display: none; }
    .speas-assistant-person .speas-assistant-bubble { top: 2px; padding: 6px 8px; }
    .speas-person-status { display: none; }
}

/* Pasos de enrolamiento MFA dentro del mismo lenguaje del acceso. */
.paso { display: none; }
.paso.show { display: grid; animation: auth-reveal 180ms ease-out; }
.auth-callout { margin: 0; padding: 10px 12px; border-left: 3px solid var(--auth-accent); border-radius: 0 10px 10px 0; background: var(--auth-accent-soft); color: var(--auth-muted); font-size: 11px; line-height: 1.45; }
.auth-secret-wrap { display: grid; gap: 6px; }
.auth-secret-wrap > span { color: var(--auth-text); font-size: 11px; font-weight: 820; }
.auth-secret { margin: 0; padding: 11px 12px; border: 1px solid var(--auth-line); border-radius: 12px; background: var(--auth-surface-soft); color: var(--auth-text); font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; font-weight: 700; letter-spacing: .1em; line-height: 1.65; overflow-wrap: anywhere; }
.auth-copy { width: 100%; min-height: 40px; }
.auth-steps { display: grid; gap: 5px; margin: 0; padding-left: 18px; color: var(--auth-muted); font-size: 10px; line-height: 1.45; }
.auth-steps strong { color: var(--auth-text); }
body[data-login-portal="mfa"] .auth-card { overflow-y: auto; }
body[data-login-portal="mfa"] #paso-2 { gap: 10px; }

@media (max-width: 820px) and (max-height: 740px) {
    body[data-login-portal="mfa"] .auth-main { align-items: stretch; overflow-y: auto; }
    body[data-login-portal="mfa"] .auth-card { max-height: none; }
}
