/* XpertPro — pantallas de autenticación */
.xpert-auth-page {
    margin: 0;
    min-height: 100vh;
    background: #f0f4f8;
}

.xpert-auth-page.dark-version {
    background: #0f1419;
}

.xpert-auth {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.xpert-auth__hero {
    display: none;
    flex: 0 0 44%;
    max-width: 44%;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 60% at 20% 20%, rgba(73, 163, 241, 0.35) 0%, transparent 55%),
        linear-gradient(155deg, var(--app-accent-gradient-start, #49a3f1) 0%, var(--app-accent-solid, #124a6b) 42%, var(--app-accent-solid-hover, #0d3550) 100%);
    color: #fff;
    padding: 3rem 3.5rem;
}

.xpert-auth__hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

.xpert-auth__hero-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 24rem;
}

.xpert-auth__brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    width: fit-content;
    margin-bottom: 1.75rem;
}

.xpert-auth__brand-plate {
    display: inline-flex;
    padding: 0.7rem 0.95rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.xpert-auth__logo {
    display: block;
    width: auto;
    height: auto;
}

.xpert-auth__logo--product {
    width: 11.25rem;
    height: auto;
}

.xpert-auth__brand .xpert-auth__logo--product {
    width: 11.75rem;
}

.xpert-auth__hero-title {
    font-size: 1.7rem;
    font-weight: 600;
    line-height: 1.28;
    margin: 0 0 0.65rem;
    letter-spacing: -0.025em;
    max-width: 21.5rem;
}

.xpert-auth__hero-lead {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    opacity: 0.9;
    max-width: 21.5rem;
}

.xpert-auth__panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1.25rem;
}

.xpert-auth__panel-inner {
    width: 100%;
    max-width: 26rem;
}

.xpert-auth__steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    margin-bottom: 1.35rem;
}

.xpert-auth__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.28rem;
    color: #94a3b8;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.xpert-auth__step-num {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    background: #e2e8f0;
    color: #64748b;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.xpert-auth__step.is-active .xpert-auth__step-num {
    background: var(--app-accent-solid, #124a6b);
    color: #fff;
    box-shadow: 0 4px 12px rgba(var(--app-accent-rgb, 18, 74, 107), 0.35);
}

.xpert-auth__step.is-active {
    color: var(--app-accent-solid, #124a6b);
}

.xpert-auth__step.is-done .xpert-auth__step-num {
    background: rgba(var(--app-accent-rgb, 18, 74, 107), 0.15);
    color: var(--app-accent-solid, #124a6b);
}

.xpert-auth__step.is-done {
    color: #64748b;
}

.xpert-auth__step-label {
    display: block;
    line-height: 1.15;
    white-space: nowrap;
}

.xpert-auth__step-line {
    width: 1.35rem;
    height: 2px;
    flex: 0 0 auto;
    background: #e2e8f0;
    margin: calc((1.65rem - 2px) / 2) 0.28rem 0;
    border-radius: 1px;
}

.xpert-auth__step-line.is-done {
    background: rgba(var(--app-accent-rgb, 18, 74, 107), 0.35);
}

.xpert-auth__card {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.06),
        0 20px 40px -12px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(15, 23, 42, 0.06);
    padding: 2rem 1.75rem 1.75rem;
}

.dark-version .xpert-auth__card {
    background: #1a2332;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.45);
}

.xpert-auth__card-head {
    text-align: center;
    margin-bottom: 1.5rem;
}

.xpert-auth__card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
}

.dark-version .xpert-auth__card-title {
    color: #f1f5f9;
}

.xpert-auth__card-sub {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
    line-height: 1.45;
}

.dark-version .xpert-auth__card-sub {
    color: #94a3b8;
}

.xpert-auth__credit {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.dark-version .xpert-auth__credit {
    color: #94a3b8;
}

.xpert-auth__user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: #f1f5f9;
    font-size: 0.8rem;
    color: #475569;
    max-width: 100%;
}

.dark-version .xpert-auth__user-chip {
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
}

.xpert-auth__user-chip .material-icons-round {
    font-size: 1.1rem;
    opacity: 0.7;
}

.xpert-auth__user-chip strong {
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark-version .xpert-auth__user-chip strong {
    color: #f8fafc;
}

.xpert-auth__alert {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.8125rem;
    line-height: 1.45;
    margin-bottom: 1.25rem;
}

.xpert-auth__alert .material-icons-round {
    font-size: 1.15rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.xpert-auth__alert--success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.xpert-auth__field-error {
    margin: 0.4rem 0 0;
    font-size: 0.75rem;
    color: #b91c1c;
}

.xpert-auth__recaptcha {
    display: flex;
    justify-content: center;
}

.xpert-auth__forgot-form {
    margin-top: 0.85rem;
    text-align: center;
}

.xpert-auth__link--button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

.xpert-auth__field {
    margin-bottom: 1.15rem;
}

.xpert-auth__label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.4rem;
}

.dark-version .xpert-auth__label {
    color: #94a3b8;
}

.xpert-auth__input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.xpert-auth__input-icon {
    position: absolute;
    left: 0.9rem;
    color: #94a3b8;
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 1;
}

.xpert-auth__input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.65rem;
    font-size: 0.9375rem;
    line-height: 1.4;
    color: #1e293b;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.xpert-auth__input:focus {
    outline: none;
    border-color: var(--app-accent-solid, #124a6b);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(var(--app-accent-rgb, 18, 74, 107), 0.15);
}

.dark-version .xpert-auth__input {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

.dark-version .xpert-auth__input:focus {
    background: rgba(255, 255, 255, 0.06);
}

.xpert-auth__input-wrap--password .xpert-auth__input {
    padding-right: 2.75rem;
}

.xpert-auth__toggle-pw {
    position: absolute;
    right: 0.65rem;
    background: none;
    border: none;
    padding: 0.35rem;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 0.35rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.xpert-auth__toggle-pw:hover {
    color: var(--app-accent-solid, #124a6b);
    background: rgba(var(--app-accent-rgb, 18, 74, 107), 0.08);
}

.xpert-auth__remember {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    cursor: pointer;
    user-select: none;
}

.xpert-auth__remember input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--app-accent-solid, #124a6b);
    cursor: pointer;
}

.xpert-auth__remember span {
    font-size: 0.8125rem;
    color: #64748b;
}

.dark-version .xpert-auth__remember span {
    color: #94a3b8;
}

.xpert-auth__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--app-accent-gradient-start, #49a3f1) 0%, var(--app-accent-solid, #124a6b) 100%);
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 4px 14px rgba(var(--app-accent-rgb, 18, 74, 107), 0.35);
}

/* Alias legacy usado en 2FA antes del restyle */
.xpert-auth__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--app-accent-gradient-start, #49a3f1) 0%, var(--app-accent-solid, #124a6b) 100%);
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 4px 14px rgba(var(--app-accent-rgb, 18, 74, 107), 0.35);
}

.xpert-auth__btn:hover,
.xpert-auth__submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--app-accent-rgb, 18, 74, 107), 0.4);
    color: #fff;
}

.xpert-auth__btn:active,
.xpert-auth__submit:active {
    transform: translateY(0);
}

.xpert-auth__btn .material-icons-round,
.xpert-auth__submit .material-icons-round {
    font-size: 1.15rem;
}

.xpert-auth__footer {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.dark-version .xpert-auth__footer {
    border-top-color: rgba(255, 255, 255, 0.06);
}

.xpert-auth__link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--app-accent-solid, #124a6b);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.xpert-auth__link:hover {
    color: var(--app-accent-solid-hover, #0d3550);
    text-decoration: underline;
}

.xpert-auth__tenant-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.xpert-auth__tenant-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.9rem 1rem;
    text-align: left;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.xpert-auth__tenant-btn:hover {
    border-color: var(--app-accent-solid, #124a6b);
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--app-accent-rgb, 18, 74, 107), 0.12);
}

.dark-version .xpert-auth__tenant-btn {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.dark-version .xpert-auth__tenant-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

.xpert-auth__tenant-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    background: rgba(var(--app-accent-rgb, 18, 74, 107), 0.1);
    color: var(--app-accent-solid, #124a6b);
    display: flex;
    align-items: center;
    justify-content: center;
}

.xpert-auth__tenant-icon .material-icons-round {
    font-size: 1.25rem;
}

.xpert-auth__tenant-text {
    flex: 1;
    min-width: 0;
}

.xpert-auth__tenant-name {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.dark-version .xpert-auth__tenant-name {
    color: #f1f5f9;
}

.xpert-auth__tenant-meta {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.15rem;
}

.xpert-auth__tenant-arrow {
    color: #cbd5e1;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.xpert-auth__tenant-btn:hover .xpert-auth__tenant-arrow {
    color: var(--app-accent-solid, #124a6b);
}

.xpert-auth__tenant-search {
    margin-bottom: 0.85rem;
}

.xpert-auth__tenant-search .xpert-auth__input::-webkit-search-cancel-button {
    cursor: pointer;
}

.xpert-auth__tenant-list > form[hidden] {
    display: none;
}

.xpert-auth__tenant-empty {
    margin: 0.35rem 0 0;
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    text-align: center;
    color: #64748b;
    background: #f8fafc;
    border: 1.5px dashed #e2e8f0;
    border-radius: 0.85rem;
}

.xpert-auth__tenant-empty[hidden] {
    display: none;
}

.dark-version .xpert-auth__tenant-empty {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

.xpert-auth__mobile-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 1.15rem;
}

.xpert-auth__mobile-brand .xpert-auth__logo--product {
    width: 9.75rem;
}

.dark-version .xpert-auth__mobile-brand .xpert-auth__logo--product {
    background: #fff;
    border-radius: 0.7rem;
    padding: 0.35rem 0.5rem;
}

@media (min-width: 992px) and (max-width: 1400px) {
    .xpert-auth__hero {
        padding: 2.25rem 2.4rem;
    }

    .xpert-auth__hero-title {
        font-size: 1.55rem;
    }
}

@media (min-width: 992px) {
    /* La marca queda fija al alto visible; solo el formulario hace scroll. */
    .xpert-auth {
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    .xpert-auth__hero {
        display: flex;
        height: 100%;
    }

    .xpert-auth__panel {
        height: 100%;
        overflow-y: auto;
        overscroll-behavior: contain;
        align-items: flex-start;
    }

    .xpert-auth__panel-inner {
        margin: auto 0;
    }

    .xpert-auth__steps {
        align-items: center;
        margin-bottom: 1.5rem;
    }

    .xpert-auth__step {
        flex-direction: row;
        gap: 0.5rem;
        font-size: 0.75rem;
        letter-spacing: 0.04em;
    }

    .xpert-auth__step-line {
        width: 2.5rem;
        margin: 0 0.35rem;
    }

    .xpert-auth__mobile-brand {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .xpert-auth__panel {
        padding: 1.15rem 1rem 1.35rem;
        background:
            radial-gradient(ellipse 100% 80% at 50% -20%, rgba(var(--app-accent-rgb, 18, 74, 107), 0.12) 0%, transparent 55%),
            #f0f4f8;
    }

    .dark-version .xpert-auth__panel {
        background: #0f1419;
    }

    .xpert-auth__panel-inner {
        max-width: 24.5rem;
    }

    .xpert-auth__steps {
        margin-bottom: 1.15rem;
    }
}

@media (max-width: 991.98px) and (max-height: 700px) {
    .xpert-auth__panel {
        align-items: flex-start;
        padding-top: 0.75rem;
    }

    .xpert-auth__mobile-brand {
        margin-bottom: 0.75rem;
    }

    .xpert-auth__mobile-brand .xpert-auth__logo--product {
        width: 8.5rem;
    }

    .xpert-auth__steps {
        margin-bottom: 0.85rem;
    }
}

.xpert-auth__2fa-form {
    margin-top: 0.25rem;
}

.xpert-auth__input--otp {
    letter-spacing: 0.12em;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.xpert-auth__2fa-box {
    display: grid;
    gap: 0.85rem;
    justify-items: center;
    margin: 0.35rem 0 1.25rem;
    padding: 1rem 1rem 1.1rem;
    border-radius: 0.9rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.dark-version .xpert-auth__2fa-box {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.xpert-auth__2fa-qr {
    display: grid;
    place-items: center;
    padding: 0.65rem;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.xpert-auth__2fa-qr svg {
    display: block;
    max-width: 180px;
    height: auto;
}

.dark-version .xpert-auth__2fa-qr {
    background: #fff;
}

.xpert-auth__2fa-secret {
    margin: 0;
    text-align: center;
    max-width: 100%;
}

.xpert-auth__2fa-secret-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.3rem;
}

.xpert-auth__2fa-secret code {
    display: inline-block;
    font-size: 0.84rem;
    letter-spacing: 0.08em;
    padding: 0.4rem 0.65rem;
    border-radius: 0.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    word-break: break-all;
}

.dark-version .xpert-auth__2fa-secret code {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
}

.xpert-auth__recovery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    margin: 0.35rem 0 1.25rem;
    padding: 0;
    list-style: none;
}

.xpert-auth__recovery-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.84rem;
    letter-spacing: 0.04em;
    text-align: center;
    padding: 0.65rem 0.55rem;
    border-radius: 0.65rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
}

.dark-version .xpert-auth__recovery-code {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

@media (max-width: 420px) {
    .xpert-auth__recovery-grid {
        grid-template-columns: 1fr;
    }
}

.fixed-plugin {
    display: none !important;
}
