/* Login XAF, verificación y selección de empresa. Sin reglas sobre las vistas de negocio. */
body:has(#logon-template-component),
body:has(.suite-auth-page) {
    background: var(--suite-shell-bg) !important;
    color-scheme: light;
}

.suite-auth-page,
#logon-template-component {
    --suite-login-link-color: var(--suite-shell-focus);
    --suite-login-link-hover: var(--suite-shell-focus);
    --dxbl-text-edit-bg: var(--suite-color-surface);
    --dxbl-text-edit-color: var(--suite-color-text);
    --dxbl-text-edit-underline-color: transparent;
    --dxbl-text-edit-underline-focused-color: transparent;
    --dxds-color-content-neutral-default-rest: var(--suite-color-text);
    --dxds-color-surface-neutral-default-rest: var(--suite-color-surface);
    color: var(--suite-color-text);
}

.suite-auth-page {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(1rem, 4vw, 3rem);
    background-color: var(--suite-color-primary-soft);
    background-image: linear-gradient(rgb(255 255 255 / 15%), rgb(255 255 255 / 28%)), url('../images/branding/bg-ibness-render.png');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    font-family: "Segoe UI", system-ui, sans-serif;
    font-size: var(--suite-auth-font-size);
    line-height: 1.5;
}

.suite-auth-card {
    box-sizing: border-box;
    width: min(100%, 30rem);
    min-width: 0;
    padding: clamp(1.25rem, 4vw, 2.25rem);
    border: 1px solid var(--suite-shell-border);
    border-radius: 1.25rem;
    background: var(--suite-shell-surface);
    box-shadow: 0 1rem 3rem rgb(20 34 56 / 10%);
}

.suite-auth-card--tenant { width: min(100%, 40rem); }
.suite-auth-card--login { width: min(100%, 36rem); }
.suite-auth-card--signup {
    width: min(100%, 38.5rem);
    padding: clamp(1.25rem, 2.8vh, 1.85rem) clamp(1.35rem, 3.2vw, 2.25rem);
    border-radius: 1.15rem;
    box-shadow: 0 .75rem 2.25rem rgb(0 49 64 / 8%), 0 .15rem .45rem rgb(0 49 64 / 4%);
}
.suite-auth-page--signup {
    padding: clamp(.75rem, 2vh, 1.75rem) clamp(.85rem, 3vw, 2rem);
}
.suite-auth-login-content { min-width: 0; width: 100%; }
.suite-auth-brand { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.suite-auth-card--signup .suite-auth-brand { margin-bottom: .9rem; }
.suite-auth-heading { margin-bottom: 1.25rem; text-align: left; }
.suite-auth-card--signup .suite-auth-heading { margin-bottom: .85rem; }
.suite-auth-heading h1 { margin: 0 0 .4rem; color: var(--suite-shell-text); font-size: var(--suite-auth-title-font-size); font-weight: 650; line-height: 1.2; letter-spacing: -.025em; }
.suite-auth-card--signup .suite-auth-heading h1 { margin-bottom: .2rem; font-size: clamp(1.3rem, 2.3vh, 1.5rem); font-weight: 650; }
.suite-auth-heading p { margin: 0; color: var(--suite-shell-muted); font-size: var(--suite-auth-font-size); overflow-wrap: anywhere; }
.suite-auth-card--signup .suite-auth-heading p { font-size: .925rem; line-height: 1.4; }
.suite-auth-heading .suite-auth-eyebrow { margin-bottom: .45rem; color: var(--suite-shell-focus); font-size: var(--suite-auth-small-font-size); font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.suite-auth-heading strong { color: var(--suite-shell-text); font-weight: 600; }
.suite-auth-intro { margin: 0 0 .85rem; color: var(--suite-shell-muted); font-size: var(--suite-auth-font-size); line-height: 1.55; }

/* Agrupación visual entre datos personales y datos de empresa sin encabezados innecesarios. */
.suite-auth-section {
    min-width: 0;
}
.suite-auth-section--company {
    margin-top: .35rem;
    padding-top: .75rem;
    border-top: 1px solid var(--suite-shell-border);
}

.suite-auth-field { margin-bottom: 1.1rem; min-width: 0; }
.suite-auth-card--signup .suite-auth-field { margin-bottom: .65rem; }
.suite-auth-card--signup .suite-auth-field--terms { margin-top: .35rem; margin-bottom: 1rem; }
.suite-auth-field label { display: block; margin-bottom: .3rem; font-size: var(--suite-auth-font-size); font-weight: 600; color: var(--suite-shell-text); }
.suite-auth-card--signup .suite-auth-field > label { margin-bottom: .28rem; font-size: .875rem; font-weight: 600; line-height: 1.3; }
.suite-auth-optional { color: var(--suite-shell-muted); font-weight: 400; font-size: .82rem; }
.suite-auth-field-help { margin: 0 0 .75rem; color: var(--suite-shell-muted); font-size: var(--suite-auth-small-font-size); }
.suite-auth-input { --suite-shell-border: var(--suite-shell-control-border); box-sizing: border-box; width: 100%; min-height: 2.75rem; padding: .6rem .8rem; border: 1px solid var(--suite-shell-border); border-radius: .6rem; background: var(--suite-shell-surface); color: var(--suite-shell-text); font: inherit; transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
.suite-auth-card--signup .suite-auth-input { min-height: 2.5rem; padding: .45rem .75rem; font-size: .9375rem; border-radius: .55rem; }
.suite-auth-input::placeholder { color: var(--suite-shell-muted); opacity: .7; }

.suite-auth-grid-row,
.suite-auth-company-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .85rem;
}
.suite-auth-grid-row .suite-auth-field,
.suite-auth-company-row .suite-auth-field { min-width: 0; }

/* Control unificado para prefijo (+34) y teléfono. */
.suite-auth-phone-row {
    min-width: 0;
}
.suite-auth-phone-combo {
    display: flex;
    align-items: stretch;
    width: 100%;
    border: 1px solid var(--suite-shell-control-border);
    border-radius: .55rem;
    background: var(--suite-shell-surface);
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.suite-auth-phone-combo:focus-within {
    border-color: var(--suite-shell-focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--suite-shell-focus) 16%, transparent);
}
.suite-auth-field--invalid .suite-auth-phone-combo,
.suite-auth-phone-combo:has([aria-invalid="true"]) {
    border-color: var(--suite-color-danger);
}
.suite-auth-phone-combo .suite-auth-input {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}
.suite-auth-phone-combo .suite-auth-phone-prefix {
    flex: 0 0 4.25rem;
    width: 4.25rem;
    padding-inline: .55rem;
    text-align: center;
    font-weight: 600;
    color: var(--suite-shell-text);
    background: var(--suite-shell-bg);
}
.suite-auth-phone-combo .suite-auth-phone-prefix:focus-visible {
    background: var(--suite-shell-surface);
}
.suite-auth-phone-divider {
    flex: 0 0 1px;
    width: 1px;
    background: var(--suite-shell-border);
}
.suite-auth-phone-combo .suite-auth-phone-number {
    flex: 1 1 auto;
    min-width: 0;
}

/* Botón oficial de inicio de sesión / registro con Microsoft (estilo secundario limpio y profesional). */
.suite-auth-microsoft-btn,
#logon-template-component .auth-provider-btn,
#logon-template-component .dxbl-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    box-sizing: border-box;
    width: 100%;
    min-height: 2.65rem;
    padding: .55rem 1rem;
    border: 1px solid var(--suite-shell-border);
    border-radius: .6rem;
    background: var(--suite-shell-surface);
    color: var(--suite-shell-text);
    font: inherit;
    font-size: var(--suite-auth-font-size);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgb(0 49 64 / 5%);
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.suite-auth-card--signup .suite-auth-microsoft-btn {
    min-height: 2.5rem;
    padding: .45rem 1rem;
    border-color: color-mix(in srgb, var(--suite-shell-control-border) 55%, var(--suite-shell-border));
    border-radius: .55rem;
    font-size: .925rem;
    font-weight: 600;
}
.suite-auth-microsoft-btn:hover:not(:disabled),
#logon-template-component .auth-provider-btn:hover:not(:disabled),
#logon-template-component .dxbl-btn-secondary:hover:not(:disabled) {
    background: var(--suite-shell-hover);
    border-color: var(--suite-shell-control-border);
}
.suite-auth-microsoft-btn:active:not(:disabled),
#logon-template-component .auth-provider-btn:active:not(:disabled),
#logon-template-component .dxbl-btn-secondary:active:not(:disabled) {
    background: var(--suite-shell-border);
}
.suite-auth-microsoft-logo {
    display: block;
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 1.15rem;
}

/* Separador entre la opción de Microsoft y el formulario con correo. */
.suite-auth-separator,
#logon-template-component .middle-text-separator {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: .9rem 0;
    color: var(--suite-shell-muted);
    font-size: var(--suite-auth-small-font-size);
    text-align: center;
}
.suite-auth-card--signup .suite-auth-separator { margin: .65rem 0 .7rem; font-size: .82rem; }
.suite-auth-separator::before,
.suite-auth-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--suite-shell-border);
}

/* Modo Microsoft: tarjeta informativa superior y correo bloqueado con candado. */
.suite-auth-microsoft-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .65rem;
    margin-bottom: .65rem;
    padding: .55rem .8rem;
    border: 1px solid color-mix(in srgb, var(--suite-shell-focus) 30%, var(--suite-shell-border));
    border-radius: .65rem;
    background: var(--suite-shell-accent-soft);
}
.suite-auth-microsoft-banner-info {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
    flex: 1 1 14rem;
}
.suite-auth-microsoft-banner-text { min-width: 0; }
.suite-auth-microsoft-banner-title {
    margin: 0;
    color: var(--suite-shell-text);
    font-size: .86rem;
    font-weight: 600;
    line-height: 1.25;
}
.suite-auth-microsoft-banner-email {
    margin: .1rem 0 0;
    color: var(--suite-shell-focus);
    font-size: .84rem;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.suite-auth-microsoft-switch {
    padding: .2rem .35rem;
    font-size: .84rem;
    font-weight: 600;
    white-space: nowrap;
}

.suite-auth-locked-field {
    position: relative;
    display: flex;
    align-items: center;
}
.suite-auth-input--locked {
    padding-right: 2.3rem !important;
    border-color: color-mix(in srgb, var(--suite-shell-focus) 38%, var(--suite-shell-border));
    background: color-mix(in srgb, var(--suite-shell-accent-soft) 55%, var(--suite-shell-surface));
    color: var(--suite-shell-text);
    font-weight: 500;
    cursor: default;
}
.suite-auth-lock-badge {
    position: absolute;
    right: .6rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: .35rem;
    background: var(--suite-shell-surface);
    color: var(--suite-shell-focus);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--suite-shell-focus) 25%, var(--suite-shell-border));
    pointer-events: none;
}

/* Validación en línea junto a cada campo y animación sutil. */
.suite-auth-field-error {
    margin: .2rem 0 0;
    color: var(--suite-color-danger);
    font-size: .8rem;
    font-weight: 500;
    line-height: 1.25;
}
.suite-auth-terms-check {
    display: flex !important;
    align-items: flex-start;
    gap: .55rem;
    margin: 0 !important;
    font-size: .875rem !important;
    font-weight: 500 !important;
    line-height: 1.35;
    cursor: pointer;
}
.suite-auth-terms-text {
    color: var(--suite-shell-text);
}
.suite-auth-checkbox {
    width: 1.05rem;
    height: 1.05rem;
    margin: .1rem 0 0;
    flex: 0 0 1.05rem;
    accent-color: var(--suite-shell-focus);
    cursor: pointer;
}
.suite-auth-checkbox[aria-invalid="true"] {
    outline: 2px solid var(--suite-color-danger);
    outline-offset: 1px;
}

@keyframes suite-auth-shake-a {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}
@keyframes suite-auth-shake-b {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}
.suite-auth-field--shake-a :is(.suite-auth-input, .suite-auth-phone-combo, .suite-auth-terms-check) {
    animation: suite-auth-shake-a .32s ease;
}
.suite-auth-field--shake-b :is(.suite-auth-input, .suite-auth-phone-combo, .suite-auth-terms-check) {
    animation: suite-auth-shake-b .32s ease;
}

.suite-auth-footer-links {
    display: grid;
    justify-items: center;
    gap: .3rem;
    margin: .9rem 0 0;
    text-align: center;
}
.suite-auth-footer-primary {
    margin: 0;
    color: var(--suite-shell-muted);
    font-size: .88rem;
    line-height: 1.4;
}
.suite-auth-footer-primary a {
    font-weight: 600;
}
.suite-auth-footer-secondary {
    margin: 0;
    color: var(--suite-shell-muted);
    font-size: .82rem;
    line-height: 1.35;
}
.suite-auth-footer-dot { color: var(--suite-shell-muted); }
.suite-auth-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.suite-auth-email { overflow-wrap: anywhere; }
.suite-auth-card--sent {
    text-align: center;
    padding: clamp(1.4rem, 3.2vh, 2.2rem) clamp(1.35rem, 3.8vw, 2.3rem);
}
.suite-auth-sent-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.35rem;
}
.suite-auth-sent-icon {
    display: grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    margin-bottom: .35rem;
    border-radius: 50%;
    background: var(--suite-shell-accent-soft);
    color: var(--suite-shell-primary);
    box-shadow: 0 4px 14px rgb(0 111 145 / 12%);
}
.suite-auth-sent-heading {
    margin-bottom: .15rem;
}
.suite-auth-sent-heading h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.02em;
}
.suite-auth-sent-sub {
    margin: 0;
    color: var(--suite-shell-muted);
    font-size: var(--suite-auth-font-size);
    line-height: 1.45;
}
.suite-auth-sent-email {
    margin: .1rem 0 .25rem;
    padding: .35rem .85rem;
    border-radius: .5rem;
    background: var(--suite-shell-hover);
    border: 1px solid var(--suite-shell-border);
    color: var(--suite-shell-text);
    font-size: 1.05rem;
    max-width: 100%;
}
.suite-auth-sent-body {
    margin: .2rem 0 .35rem;
    color: var(--suite-shell-text);
    font-size: var(--suite-auth-font-size);
    line-height: 1.5;
    max-width: 30ch;
}
.suite-auth-sent-hint {
    margin: .35rem 0 0;
    color: var(--suite-shell-muted);
    font-size: var(--suite-auth-small-font-size);
    line-height: 1.45;
}
.suite-auth-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    font-size: var(--suite-auth-small-font-size);
    font-weight: 600;
}
.suite-auth-step {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--suite-shell-muted);
}
.suite-auth-step--done { color: var(--suite-shell-primary); }
.suite-auth-step--current { color: var(--suite-shell-text); font-weight: 700; }
.suite-auth-step-badge {
    display: inline-grid;
    place-items: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 50%;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
}
.suite-auth-step--done .suite-auth-step-badge {
    background: var(--suite-shell-primary);
    color: var(--suite-color-on-primary);
}
.suite-auth-step--current .suite-auth-step-badge {
    background: var(--suite-shell-accent-soft);
    color: var(--suite-shell-primary);
    border: 2px solid var(--suite-shell-primary);
}
.suite-auth-step-line {
    flex: 0 0 2.5rem;
    height: 2px;
    border-radius: 1px;
    background: var(--suite-shell-primary);
}
.suite-auth-code-form { display: grid; gap: .9rem; margin-top: 1.2rem; }
.suite-auth-code-boxes {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 3rem));
    justify-content: center;
    gap: .55rem;
}
.suite-auth-code-box {
    width: 100%;
    height: 3.35rem;
    padding: 0;
    border: 1.5px solid var(--suite-shell-control-border, var(--suite-shell-border));
    border-radius: .65rem;
    background: var(--suite-shell-surface);
    color: var(--suite-shell-text);
    font: inherit;
    font-size: 1.45rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.suite-auth-code-box:focus,
.suite-auth-code-box:focus-visible {
    outline: none !important;
    border-color: var(--suite-shell-focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--suite-shell-focus) 18%, transparent);
}
.suite-auth-code-boxes--invalid .suite-auth-code-box,
.suite-auth-code-box[aria-invalid="true"] {
    border-color: var(--suite-color-danger);
}
.suite-auth-code-input {
    justify-self: center;
    width: min(100%, 17rem);
    min-height: 3.5rem;
    padding: .6rem .75rem;
    border-radius: .75rem;
    font-size: 1.85rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    text-align: center;
    letter-spacing: .55em;
    text-indent: .55em;
}
.suite-auth-code-input::placeholder { color: var(--suite-shell-muted); opacity: .5; }
.suite-auth-code-form .suite-auth-primary { margin-top: .25rem; }
.suite-auth-resend {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .35rem;
    margin: 1.05rem 0 0;
    color: var(--suite-shell-muted);
    font-size: var(--suite-auth-small-font-size);
}
.suite-auth-resend-action { padding: .15rem 0; font-size: var(--suite-auth-small-font-size); font-weight: 600; }
.suite-auth-resend-action:disabled { text-decoration: none; }
.suite-auth-back-link { text-decoration: none; font-weight: 500; }
.suite-auth-back-link:hover { text-decoration: underline; }
.suite-auth-divider { width: 100%; margin: 1.25rem 0 0; border: 0; border-top: 1px solid var(--suite-shell-border); }
@media (max-width: 380px) {
    .suite-auth-code-input { font-size: 1.5rem; letter-spacing: .4em; text-indent: .4em; }
    .suite-auth-code-boxes { gap: .35rem; grid-template-columns: repeat(6, minmax(0, 2.55rem)); }
    .suite-auth-code-box { height: 2.95rem; font-size: 1.25rem; }
    .suite-auth-step-line { flex-basis: 1.5rem; }
}
.suite-auth-password-input { position: relative; }
.suite-auth-password-input .suite-auth-input { padding-right: 3.4rem; }
.suite-auth-password-toggle { position: absolute; right: .2rem; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 0; border-radius: .35rem; background: transparent; color: var(--suite-shell-focus); cursor: pointer; }
.suite-auth-password-toggle:hover { background: var(--suite-shell-hover); }
.suite-auth-password-toggle .dx-icon { font-size: 1.25rem; }


.suite-auth-primary,
#logon-template-component .dxbl-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    width: 100%;
    min-height: 2.75rem;
    padding: .7rem 1rem;
    border: 1px solid var(--suite-shell-primary-border);
    border-radius: .6rem;
    background: var(--suite-shell-primary);
    color: var(--suite-color-on-primary);
    font: inherit;
    font-size: var(--suite-auth-font-size);
    font-weight: 650;
    box-shadow: 0 2px 6px rgb(0 111 145 / 18%);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}

.suite-auth-primary:hover:not(:disabled),
#logon-template-component .dxbl-btn-primary:hover:not(:disabled):not(.dxbl-disabled):not([aria-disabled="true"]) { color: var(--suite-shell-primary-hover-text); background: var(--suite-shell-primary-hover); border-color: var(--suite-shell-primary-hover); box-shadow: 0 4px 10px rgb(0 111 145 / 24%); }
.suite-auth-primary:active:not(:disabled),
#logon-template-component .dxbl-btn-primary:active:not(:disabled):not(.dxbl-disabled):not([aria-disabled="true"]) { color: var(--suite-shell-primary-active-text); background: var(--suite-shell-primary-active); border-color: var(--suite-shell-primary-active); box-shadow: 0 1px 3px rgb(0 80 105 / 20%); }
.suite-auth-primary:disabled,
#logon-template-component .dxbl-btn-primary:is(:disabled, .dxbl-disabled, [aria-disabled="true"]) { border-color: var(--suite-shell-border); background: var(--suite-button-disabled-bg); color: var(--suite-button-disabled-text); box-shadow: none; opacity: 1; cursor: not-allowed; }
.suite-auth-page a { color: var(--suite-shell-focus); text-decoration: underline; text-underline-offset: .18em; }
.suite-auth-page a:hover { color: var(--suite-shell-link-hover); }
.suite-auth-page a.suite-auth-primary { color: var(--suite-color-on-primary); text-decoration: none; }
.suite-auth-page a.suite-auth-primary:hover { color: var(--suite-shell-primary-hover-text); }
.suite-auth-page a.suite-auth-primary:active { color: var(--suite-shell-primary-active-text); }
.suite-auth-page :where(button, a, input[type="checkbox"]):focus-visible,
#logon-template-component :where(button, a):focus-visible {
    outline: 2px solid var(--suite-shell-focus) !important;
    outline-offset: 2px;
}
.suite-auth-input:focus-visible {
    outline: none !important;
    border-color: var(--suite-shell-focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--suite-shell-focus) 16%, transparent);
}
.suite-auth-input[aria-invalid="true"] { border-color: var(--suite-color-danger); }
.suite-auth-input[aria-invalid="true"]:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--suite-color-danger) 16%, transparent);
}
.suite-auth-bg :is(input, button, a):focus-visible {
    outline: 2px solid var(--suite-shell-focus) !important;
    outline-offset: 3px;
}
.suite-auth-footer { margin: 1.25rem 0 0; text-align: center; font-size: var(--suite-auth-font-size); }
.suite-auth-link { color: var(--suite-shell-focus); background: transparent; border: 0; padding: .5rem 0; font: inherit; text-decoration: underline; cursor: pointer; }
.suite-auth-link:hover:not(:disabled) { color: var(--suite-shell-link-hover); }
.suite-auth-link:disabled { cursor: default; color: var(--suite-shell-muted); }

.suite-auth-loading { display: grid; justify-items: center; gap: 1rem; margin: 0; padding: 1.5rem 0; text-align: center; color: var(--suite-shell-muted); font-size: var(--suite-auth-font-size); }
.suite-auth-loading p { margin: 0; }
.suite-auth-spinner { display: inline-block; width: 2rem; height: 2rem; border: 3px solid var(--suite-shell-accent-soft); border-top-color: var(--suite-shell-accent); border-radius: 50%; animation: suite-auth-spin .8s linear infinite; }
.suite-auth-spinner--button { width: 1rem; height: 1rem; border-width: 2px; border-color: var(--suite-shell-border); border-top-color: currentColor; }
@keyframes suite-auth-spin { to { transform: rotate(360deg); } }

.suite-tenant-list { display: grid; gap: .65rem; max-height: min(48dvh, 22rem); overflow-y: auto; padding: .3rem; margin: -.3rem; scrollbar-width: thin; }
.suite-tenant-option { display: flex; align-items: center; gap: .85rem; width: 100%; padding: .85rem; border: 1px solid var(--suite-shell-border); border-radius: .75rem; background: var(--suite-shell-surface); color: var(--suite-shell-text); text-align: left; font: inherit; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.suite-tenant-option:hover { background: var(--suite-shell-hover); border-color: var(--suite-shell-interaction); }
.suite-tenant-option.is-selected { border-color: var(--suite-shell-focus); background: var(--suite-shell-accent-soft); box-shadow: inset 3px 0 0 var(--suite-shell-focus); }
.suite-tenant-avatar { display: grid; place-items: center; flex: 0 0 2.5rem; width: 2.5rem; height: 2.5rem; border-radius: .65rem; background: var(--suite-shell-hover); color: var(--suite-shell-text); font-size: .85rem; font-weight: 650; }
.suite-tenant-option.is-selected .suite-tenant-avatar { background: #fff; }
.suite-tenant-option-text { display: grid; gap: .15rem; flex: 1; min-width: 0; }
.suite-tenant-name { font-size: var(--suite-auth-font-size); font-weight: 600; overflow-wrap: anywhere; }
.suite-tenant-option-state { color: var(--suite-shell-focus); font-size: var(--suite-auth-small-font-size); }
.suite-tenant-check { display: grid; place-items: center; flex: 0 0 1.3rem; width: 1.3rem; height: 1.3rem; border: 1px solid var(--suite-shell-control-border); border-radius: 50%; }
.suite-tenant-option.is-selected .suite-tenant-check { background: var(--suite-shell-primary); border-color: var(--suite-shell-primary-border); color: var(--suite-shell-primary-text); font-size: .8rem; }
.suite-tenant-selection { display: grid; gap: .2rem; min-height: 2.8rem; margin: 1.25rem 0 1rem; color: var(--suite-shell-muted); font-size: var(--suite-auth-small-font-size); }
.suite-tenant-selection strong { color: var(--suite-shell-text); font-size: var(--suite-auth-font-size); font-weight: 600; overflow-wrap: anywhere; }

.suite-auth-message { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-top: 1rem; padding: .8rem 1rem; border: 1px solid var(--suite-shell-border); border-radius: .65rem; background: var(--suite-shell-hover); color: var(--suite-shell-text); font-size: var(--suite-auth-small-font-size); text-align: left; overflow-wrap: anywhere; }
.suite-auth-message--info { background: var(--suite-shell-accent-soft); border-color: color-mix(in srgb, var(--suite-shell-primary) 28%, var(--suite-shell-border)); color: var(--suite-shell-text); }
.suite-auth-message-icon { display: inline-grid; place-items: center; flex: 0 0 1.35rem; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--suite-shell-primary); color: var(--suite-color-on-primary); font-size: .78rem; font-weight: 700; line-height: 1; }
.suite-auth-message--warning { color: #72501a; background: #fff8e8; border-color: #ebd7ad; }
.suite-auth-message--error { color: #a1241d; background: #fff1f0; border-color: #efc6c1; }

.suite-session-dialog-backdrop { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 1rem; background: rgb(20 34 56 / 45%); }
.suite-session-dialog p { margin: 0 0 1.25rem; color: var(--suite-shell-text); font-size: var(--suite-auth-font-size); }
.suite-session-dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; }
.suite-session-dialog-actions .suite-auth-primary { width: auto; }

/* El formulario nativo conserva ViewSite, idioma, acciones, proveedores OAuth y sus handlers. */
#logon-template-component {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    display: block;
    width: 100% !important;
    min-width: 0;
    box-sizing: border-box;
    max-width: none !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    margin: 0;
    padding: 0;
    overflow: visible !important;
    z-index: auto;
}

/* Este banner solo contiene el logo anterior; ProductBrand ya está en la tarjeta. */
.suite-auth-card--login #logon-template-component > .logon-template-header { display: none !important; }
#logon-template-component .logon-template-body,
#logon-template-component .logon-main-container { display: block; position: static; width: 100%; min-width: 0; min-height: 0; height: auto; margin: 0; padding: 0; background: transparent !important; }
.suite-auth-card--login #logon-template-component .card,
.suite-auth-card--login #logon-template-component .dxbl-card { width: 100%; max-width: none; margin: 0; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
#logon-template-component .logon-main > .card-header { padding: 0 0 1.25rem !important; border: 0; background: transparent !important; color: var(--suite-shell-text); font-size: var(--suite-auth-title-font-size); font-weight: 650; }
#logon-template-component .logon-main > .card-body { padding: 0 !important; }
/* El título y el selector de idioma nativos compartían una fila sin wrap.
   La tarjeta y las acciones pueden contraerse sin ocultar ni recortar controles. */
#logon-template-component .logon-main,
#logon-template-component .card-body,
#logon-template-component .logon-viewsite,
#logon-template-component .logon-toolbar,
#logon-template-component .logon-bottom-toolbar {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
#logon-template-component .logon-main > .card-header > div { flex-wrap: wrap; gap: .75rem; }
#logon-template-component .toolbar-language-switcher-wrapper { flex: 0 1 10rem; min-width: 0; max-width: 100%; }
#logon-template-component .logon-template-body { overflow: visible; }
#logon-template-component .dxbl-toolbar,
#logon-template-component .dxbl-btn-toolbar,
#logon-template-component .dxbl-toolbar-group,
#logon-template-component .dxbl-toolbar-item { min-width: 0; max-width: 100%; }
#logon-template-component .dxbl-btn .dxbl-text { white-space: normal; overflow-wrap: anywhere; }
.suite-auth-primary, .suite-tenant-option { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; }
#logon-template-component .xaf-static-text { display: block !important; color: var(--suite-shell-muted); font-size: var(--suite-auth-font-size); line-height: 1.5; }
#logon-template-component .dxbl-fl-cpt { color: var(--suite-shell-text); font-weight: 600; font-size: var(--suite-auth-font-size); line-height: 1.5; white-space: normal; }
#logon-template-component .dxbl-text-edit,
#logon-template-component dxbl-input-editor.dxbl-text-edit { min-height: 2.65rem; border-radius: .6rem !important; background: var(--suite-shell-surface) !important; }
#logon-template-component .dxbl-text-edit input { color: var(--suite-color-text); background: transparent; font-size: var(--suite-auth-font-size); }
#logon-template-component .dxbl-text-edit:focus-within:not(.dxbl-invalid):not([aria-invalid="true"]) {
    outline: none !important;
    border-color: var(--suite-shell-control-border) !important;
    box-shadow: none !important;
}
#logon-template-component .dxbl-text-edit input:focus-visible {
    outline: none !important;
}
#logon-template-component .dxbl-btn-primary,
#logon-template-component button[type="submit"].dxbl-btn { min-height: 2.7rem; border-radius: .6rem !important; }
#logon-template-component .auth-provider-btn,
#logon-template-component .dxbl-btn-secondary { min-height: 2.7rem; border: 1px solid var(--suite-shell-border); border-radius: .6rem; background: var(--suite-shell-surface); color: var(--suite-shell-text); }
#logon-template-component .middle-text-separator { color: var(--suite-shell-muted); margin-block: 1.2rem; font-size: var(--suite-auth-font-size); }
.suite-auth-page #forgot-pwd-link { margin-top: 1rem !important; color: var(--suite-shell-focus) !important; font-size: var(--suite-auth-font-size) !important; text-align: center !important; }
.suite-auth-page #register-link { display: block; margin-top: .75rem; font-size: var(--suite-auth-font-size); text-align: center; }
/* Campo trampa anti-bots del registro: presente en el DOM pero fuera de pantalla. */
.suite-auth-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Native editors/buttons define their own density tokens; changing only the
   card's inherited font does not enlarge their text. Scope overrides to access. */
#logon-template-component {
    font-size: var(--suite-auth-font-size);
    line-height: 1.5;
}
#logon-template-component .dxbl-fl { --dxbl-fl-font-size: var(--suite-auth-font-size); }
#logon-template-component .dxbl-text-edit {
    --dxbl-text-edit-font-size: var(--suite-auth-font-size);
    --dxbl-text-edit-line-height: 1.5;
    font-weight: 600;
}

@media (max-height: 780px) and (min-width: 561px) {
    .suite-auth-page--signup { padding-block: .4rem; }
    .suite-auth-card--signup { padding: .95rem 1.65rem; }
    .suite-auth-card--signup .suite-auth-brand { margin-bottom: .55rem; }
    .suite-auth-card--signup .suite-auth-heading { margin-bottom: .5rem; }
    .suite-auth-card--signup .suite-auth-heading h1 { font-size: 1.25rem; }
    .suite-auth-card--signup .suite-auth-section--company { margin-top: .2rem; padding-top: .55rem; }
    .suite-auth-card--signup .suite-auth-field { margin-bottom: .45rem; }
    .suite-auth-card--signup .suite-auth-field--terms { margin-top: .15rem; margin-bottom: .75rem; }
    .suite-auth-card--signup .suite-auth-input { min-height: 2.25rem; padding: .35rem .65rem; }
    .suite-auth-card--signup .suite-auth-microsoft-btn { min-height: 2.3rem; padding: .38rem .85rem; }
    .suite-auth-card--signup .suite-auth-separator { margin: .45rem 0; }
    .suite-auth-card--signup .suite-auth-primary { min-height: 2.45rem; padding: .48rem .95rem; }
    .suite-auth-card--signup .suite-auth-footer-links { margin-top: .55rem; gap: .2rem; }
}

@media (max-width: 560px) {
    .suite-auth-grid-row,
    .suite-auth-company-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }
    .suite-auth-card--signup {
        padding: 1.25rem 1.15rem;
    }
    .suite-auth-card--signup .suite-auth-heading h1 { font-size: 1.25rem; }
    .suite-auth-card--signup .suite-auth-field { margin-bottom: .55rem; }
    .suite-auth-card--signup .suite-auth-footer-links { margin-top: .65rem; }
}

@media (max-width: 480px) {
    .suite-auth-page {
        padding: max(.85rem, env(safe-area-inset-top)) .85rem max(.85rem, env(safe-area-inset-bottom));
        background-image: linear-gradient(rgb(255 255 255 / 30%), rgb(255 255 255 / 40%)), url('../images/branding/bg-ibness-render.png');
        background-position: center top;
    }
    .suite-auth-card { padding: 1.25rem; border-radius: 1rem; }
    .suite-auth-brand { margin-bottom: 1.1rem; }
    .suite-tenant-option { gap: .65rem; padding: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
    .suite-auth-spinner,
    .suite-auth-field--shake-a :is(.suite-auth-input, .suite-auth-phone-combo, .suite-auth-terms-check),
    .suite-auth-field--shake-b :is(.suite-auth-input, .suite-auth-phone-combo, .suite-auth-terms-check) {
        animation: none;
    }
    .suite-auth-page :where(button, input) { transition: none; }
}

#logon-template-component .suite-password-toggle {
    color: var(--suite-shell-focus);
    background: transparent;
    min-height: 2.65rem;
    min-width: 3.5rem;
    font-size: var(--suite-auth-small-font-size);
}

/* Keep the credential caption available as a floating label. */
#logon-template-component .dxbl-fl-item:has(.suite-login-credential) {
    position: relative;
}
#logon-template-component .dxbl-fl-item:has(.suite-login-credential) > .dxbl-fl-cpt {
    position: absolute !important;
    inset-inline-start: .75rem;
    top: 0;
    z-index: 2;
    width: auto !important;
    height: auto !important;
    padding: 0 .3rem !important;
    margin: 0 !important;
    background: var(--suite-shell-surface);
    color: var(--suite-shell-focus);
    font-size: var(--suite-auth-small-font-size);
    font-weight: 600;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%);
    transition: opacity .15s ease, color .15s ease;
}
#logon-template-component .dxbl-fl-item:has(.suite-login-credential:focus-within) > .dxbl-fl-cpt,
#logon-template-component .dxbl-fl-item:has(.suite-login-credential input:not(:placeholder-shown)) > .dxbl-fl-cpt {
    opacity: 1;
}
#logon-template-component .dxbl-fl-item:has(.suite-login-credential) > .dxbl-fl-ctrl {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}
#logon-template-component .suite-login-credential { position: relative; }
#logon-template-component .suite-login-credential input:not([type="hidden"]) {
    padding-inline-start: 2.5rem !important;
    min-width: 0;
}
#logon-template-component .suite-login-credential input::placeholder {
    color: var(--suite-shell-muted);
    opacity: 1;
    transition: color .15s ease;
}
#logon-template-component .suite-login-credential:focus-within input::placeholder {
    color: transparent;
}
#logon-template-component .suite-login-credential::before {
    content: "";
    position: absolute;
    inset-inline-start: .8rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.1rem;
    height: 1.1rem;
    background-color: var(--suite-shell-muted);
    -webkit-mask: var(--suite-login-field-icon) center / contain no-repeat;
    mask: var(--suite-login-field-icon) center / contain no-repeat;
    pointer-events: none;
    z-index: 1;
}
#logon-template-component .suite-login-username {
    --suite-login-field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 6 9 7 9-7'/%3E%3C/svg%3E");
}
#logon-template-component .suite-login-password {
    --suite-login-field-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10' width='14' height='11' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3M12 14v3'/%3E%3C/svg%3E");
}

/* Preserve Microsoft's four colors when XAF renders its SVG as a CSS mask. */
#logon-template-component .dxbl-image[style*="MicrosoftLogo"] {
    -webkit-mask: none !important;
    mask: none !important;
    background: url('../images/MicrosoftLogo.svg') center / contain no-repeat !important;
}

/* Verificación 2FA (AccesoMicrosoft.cshtml): presentación centrada, error en línea y reenvío en una sola línea. */
.suite-auth-card--verification [hidden] { display: none !important; }
.suite-auth-card--verification .suite-auth-heading { text-align: center; }
.suite-auth-card--verification .suite-auth-sent-sub { max-width: 32ch; margin: 0 auto; text-align: center; }
.suite-auth-card--verification .suite-auth-code-form { width: 100%; max-width: 21rem; margin: 1.2rem auto 0; }
.suite-auth-card--verification .suite-auth-code-form .suite-auth-primary { width: 100%; margin-top: .9rem; }
.suite-auth-card--verification .suite-auth-code-boxes { grid-template-columns: repeat(6, minmax(0, 1fr)); width: 100%; }
.suite-auth-card--verification .suite-auth-code-boxes--invalid .suite-auth-code-box,
.suite-auth-card--verification .suite-auth-code-box[aria-invalid="true"] {
    border-color: var(--suite-color-danger);
    background: color-mix(in srgb, var(--suite-color-danger) 6%, var(--suite-shell-surface));
}
.suite-auth-card--verification .suite-auth-code-boxes--invalid {
    animation: suite-auth-code-shake .3s ease-in-out 1;
}
@keyframes suite-auth-code-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
.suite-auth-card--verification .suite-auth-code-message {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .35rem;
    min-height: 1.5rem;
    margin: .5rem 0 0;
    color: var(--suite-shell-muted);
    font-size: var(--suite-auth-small-font-size);
    line-height: 1.35;
    text-align: center;
}
.suite-auth-card--verification .suite-auth-code-message--error { color: var(--suite-color-danger); }
.suite-auth-card--verification .suite-auth-code-message-icon { display: inline-grid; flex: none; }
.suite-auth-card--verification .suite-auth-code-message-icon svg { display: block; }
.suite-auth-card--verification .suite-auth-code-message-action { padding: 0; font-size: inherit; font-weight: 600; }
.suite-auth-card--verification .suite-auth-resend {
    min-height: 1.5rem;
    margin: .9rem 0 0;
    gap: .25rem;
    color: var(--suite-shell-muted);
}
.suite-auth-card--verification .suite-auth-resend-sent { color: var(--suite-shell-focus); font-weight: 600; }
.suite-auth-card--verification .suite-auth-resend-wait { font-variant-numeric: tabular-nums; }
.suite-auth-card--verification .suite-auth-resend-action {
    padding: 0;
    color: var(--suite-shell-focus);
    font-size: inherit;
    font-weight: 600;
    text-decoration: underline;
}
.suite-auth-card--verification .suite-auth-resend-action:disabled { color: var(--suite-shell-muted); text-decoration: none; cursor: default; }
.suite-auth-card--verification .suite-auth-verify-back { margin-top: 1rem; }
.suite-auth-card--verification .suite-auth-verify-back .suite-auth-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .25rem 0;
    color: var(--suite-shell-muted);
    font-weight: 500;
    text-decoration: none;
}
.suite-auth-card--verification .suite-auth-verify-back .suite-auth-link:hover:not(:disabled) {
    color: var(--suite-shell-text);
    text-decoration: none;
}
.suite-auth-card--verification .suite-auth-verify-back svg { flex: none; }
@media (prefers-reduced-motion: reduce) {
    .suite-auth-card--verification .suite-auth-code-boxes--invalid { animation: none; }
}