/* ==========================================================================
   Acceso y páginas públicas de /apl (lote 1 de MD3, docs/MD3_INVENTARIO.md §2.4): login y su diálogo,
   registro (método, asistente de 4 pasos y final), activación, restablecer contraseña, alta de conductor
   invitado, cambio de correo y tarjetas públicas de relevo e invitación de colaborador.

   Norma AGENTS §6 bis: clases semánticas BEM propias (.apl-auth__*, .apl-login__*, .apl-reg__*) con SOLO
   tokens var(--apc-…) del contrato (autopyme_components/static/src/themes/contract.json), sin reglas forzadas
   (important) ni selectores de html y body delante. Los campos, botones y el diálogo son los de
   autopyme_components (.apc-field*, .apc-button*, .apc-icon-button, .apc-dialog-*): aquí solo se colocan.

   Un mismo CSS para los dos temas: los valores que cambian entre el aspecto actual (classic) y Material
   Design 3 (md3) son variables locales --apl-auth-* declaradas en .apl-auth y redefinidas bajo
   [data-apc-theme="md3"]. Con classic, los tokens reproducen el aspecto anterior; con md3 queda M3 estándar:
   barra superior de 64, tarjeta centrada (máx. 448) en tablet/escritorio y a pantalla completa en móvil,
   campos rellenos, botones de 40 y asistente con indicador de progreso lineal.

   Se carga justo después de apl_common.css (TestCssIntegrity). Dueño: lote 1.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Variables locales por tema
   -------------------------------------------------------------------------- */
.apl-auth {
    --apl-auth-pad: var(--apc-space-5);
    --apl-auth-card-max: calc(var(--apc-space-10) * 9 + var(--apc-space-5)); /* 448 */
    --apl-auth-card-bg: var(--apc-color-surface);
    --apl-auth-card-border: var(--apc-color-outline);
    --apl-auth-card-shadow: var(--apc-elevation-4);
    --apl-auth-card-radius: var(--apc-shape-corner-lg);
    --apl-auth-card-pad: var(--apc-space-7);
    --apl-auth-appbar-height: calc(var(--apc-space-10) + var(--apc-space-3)); /* 56 */
    --apl-auth-appbar-bg: var(--apc-color-surface);
    --apl-auth-appbar-border: var(--apc-color-outline-variant);
    --apl-auth-brand-size: var(--apc-type-title-sm-size);
    --apl-auth-brand-line: var(--apc-type-title-sm-line-height);
    --apl-auth-brand-weight: var(--apc-type-title-sm-weight);
    --apl-auth-title-size: var(--apc-type-title-md-size);
    --apl-auth-title-line: var(--apc-type-title-md-line-height);
    --apl-auth-title-weight: var(--apc-type-title-md-weight);
    --apl-auth-subtitle-size: var(--apc-type-title-sm-size);
    --apl-auth-subtitle-line: var(--apc-type-title-sm-line-height);
    --apl-auth-subtitle-weight: var(--apc-type-title-sm-weight);
    --apl-auth-text-size: var(--apc-type-body-sm-size);
    --apl-auth-text-line: var(--apc-type-body-sm-line-height);
    --apl-auth-icon-box: calc(var(--apc-space-10) * 2); /* 96 */
    --apl-auth-icon-size: calc(var(--apc-space-10) + var(--apc-space-3)); /* 56 */
    --apl-auth-btn-height: var(--apc-button-height);
    --apl-auth-gap: var(--apc-space-6);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    font-family: var(--apc-font-family-plain);
    color: var(--apc-color-on-background);
}

/* Campos de autopyme_components (field.css) con los colores del tema, solo para classic: md3 los define en su
   field.css (en la raíz y en el propio campo) y aquí no deben pisarse. */
[data-apc-theme="classic"] .apl-auth {
    --apc-field-bg: var(--apc-color-surface-container-low);
    --apc-field-border: var(--apc-color-outline);
    --apc-field-border-focus: var(--apc-color-primary);
    --apc-field-focus-ring: color-mix(in srgb, var(--apc-color-primary) 20%, transparent);
    --apc-field-text: var(--apc-color-on-surface);
    --apc-field-placeholder: var(--apc-color-placeholder);
    --apc-field-label-color: var(--apc-color-on-surface-variant);
    --apc-field-help-color: var(--apc-color-on-surface-variant);
    --apc-field-invalid: var(--apc-color-error);
    --apc-field-invalid-bg: color-mix(in srgb, var(--apc-color-error) 4%, transparent);
    --apc-field-invalid-ring: color-mix(in srgb, var(--apc-color-error) 25%, transparent);
}

[data-apc-theme="md3"] .apl-auth {
    --apl-auth-card-bg: var(--apc-color-surface-container-low);
    --apl-auth-card-border: transparent;
    --apl-auth-card-shadow: var(--apc-elevation-1);
    --apl-auth-card-radius: var(--apc-shape-corner-xl);
    --apl-auth-appbar-height: calc(var(--apc-space-10) + var(--apc-space-5)); /* 64 */
    --apl-auth-appbar-bg: var(--apc-color-surface);
    --apl-auth-appbar-border: transparent;
    --apl-auth-brand-size: var(--apc-type-title-lg-size);
    --apl-auth-brand-line: var(--apc-type-title-lg-line-height);
    --apl-auth-brand-weight: var(--apc-type-title-lg-weight);
    --apl-auth-title-size: var(--apc-type-headline-sm-size);
    --apl-auth-title-line: var(--apc-type-headline-sm-line-height);
    --apl-auth-title-weight: var(--apc-type-headline-sm-weight);
    --apl-auth-subtitle-size: var(--apc-type-title-md-size);
    --apl-auth-subtitle-line: var(--apc-type-title-md-line-height);
    --apl-auth-subtitle-weight: var(--apc-type-title-md-weight);
    --apl-auth-text-size: var(--apc-type-body-md-size);
    --apl-auth-text-line: var(--apc-type-body-md-line-height);
    --apl-auth-icon-box: calc(var(--apc-space-10) + var(--apc-space-5)); /* 64 */
    --apl-auth-icon-size: calc(var(--apc-space-8) + var(--apc-space-2)); /* 36 */
    --apl-auth-gap: var(--apc-space-5);
}

@media (min-width: 600px) {
    .apl-auth {
        --apl-auth-pad: var(--apc-space-7);
    }
}

/* M3 compact (< 600): el contenido va a pantalla completa, sin tarjeta. */
@media (max-width: 599px) {
    [data-apc-theme="md3"] .apl-auth {
        --apl-auth-card-bg: transparent;
        --apl-auth-card-shadow: none;
        --apl-auth-card-radius: var(--apc-shape-corner-none);
        --apl-auth-card-pad: var(--apc-space-3) 0;
    }
}

/* --------------------------------------------------------------------------
   1. Estructura de la página: barra superior, cuerpo y pie con la versión
   -------------------------------------------------------------------------- */
.apl-auth__appbar {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: var(--apc-space-4);
    box-sizing: border-box;
    width: 100%;
    min-height: var(--apl-auth-appbar-height);
    padding: 0 var(--apl-auth-pad);
    border-bottom: var(--apc-border-width) solid var(--apl-auth-appbar-border);
    background-color: var(--apl-auth-appbar-bg);
}

.apl-auth__brand {
    display: flex;
    align-items: center;
    gap: var(--apc-space-4);
    min-width: 0;
}

.apl-auth__logo {
    display: block;
    flex-shrink: 0;
    width: var(--apc-space-8);
    height: var(--apc-space-8);
    border-radius: var(--apc-shape-corner-md);
    box-shadow: var(--apc-elevation-1);
    object-fit: cover;
}

.apl-auth__brand-name {
    overflow: hidden;
    color: var(--apc-color-on-surface);
    font-size: var(--apl-auth-brand-size);
    line-height: var(--apl-auth-brand-line);
    font-weight: var(--apl-auth-brand-weight);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.apl-auth__main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    padding: var(--apl-auth-pad);
}

/* Pie con la versión única de la suite en todas las pantallas públicas (login, registro y tarjetas; QA md3
   A1-R2-01/08): tipografía del tema, label-medium (12), nunca por debajo de 12 (label-small es 11). */
.apl-auth__footer {
    flex-shrink: 0;
    box-sizing: border-box;
    width: 100%;
    padding: var(--apc-space-4) var(--apl-auth-pad);
    border-top: var(--apc-border-width) solid var(--apl-auth-appbar-border);
    background-color: var(--apl-auth-appbar-bg);
    color: var(--apc-color-on-surface-variant);
    font-size: var(--apc-type-label-md-size);
    line-height: var(--apc-type-label-md-line-height);
    text-align: center;
}

.apl-auth__footer p {
    margin: 0;
}

/* --------------------------------------------------------------------------
   2. Piezas comunes: tarjeta, icono de estado, títulos, avisos, chips, formularios y botones
   -------------------------------------------------------------------------- */
.apl-auth__card {
    display: flex;
    flex-direction: column;
    gap: var(--apl-auth-gap);
    box-sizing: border-box;
    width: 100%;
    max-width: var(--apl-auth-card-max);
    margin: 0 auto;
    padding: var(--apl-auth-card-pad);
    border: var(--apc-border-width) solid var(--apl-auth-card-border);
    border-radius: var(--apl-auth-card-radius);
    background-color: var(--apl-auth-card-bg);
    box-shadow: var(--apl-auth-card-shadow);
    color: var(--apc-color-on-surface);
    text-align: center;
}

.apl-auth__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--apc-space-3);
}

.apl-auth__title {
    margin: 0;
    color: var(--apc-color-on-surface);
    font-size: var(--apl-auth-title-size);
    line-height: var(--apl-auth-title-line);
    font-weight: var(--apl-auth-title-weight);
}

.apl-auth__text {
    margin: 0;
    color: var(--apc-color-on-surface-variant);
    font-size: var(--apl-auth-text-size);
    line-height: var(--apl-auth-text-line);
}

.apl-auth__text strong,
.apl-auth__strong {
    color: var(--apc-color-on-surface);
    font-weight: var(--apc-type-title-sm-weight);
}

/* Subtítulo instructivo: se oculta en móvil vertical (AGENTS §5). */
@media (max-width: 599px) and (orientation: portrait) {
    .apl-auth__text--instructive {
        display: none;
    }
}

/* Tono de color de icono, chip y aviso: el elemento fija el rol y deriva sus colores en el propio elemento. */
.apl-auth__icon,
.apl-auth__chip,
.apl-auth__notice {
    --apl-auth-tone: var(--apc-color-primary);
    --apl-auth-tone-container: var(--apc-color-primary-container);
    --apl-auth-on-tone-container: var(--apc-color-on-primary-container);
}

.apl-auth__icon--success,
.apl-auth__chip--success,
.apl-auth__notice--success {
    --apl-auth-tone: var(--apc-color-success);
    --apl-auth-tone-container: var(--apc-color-success-container);
    --apl-auth-on-tone-container: var(--apc-color-on-success-container);
}

.apl-auth__icon--warning,
.apl-auth__chip--warning,
.apl-auth__notice--warning {
    --apl-auth-tone: var(--apc-color-warning);
    --apl-auth-tone-container: var(--apc-color-warning-container);
    --apl-auth-on-tone-container: var(--apc-color-on-warning-container);
}

.apl-auth__icon--error,
.apl-auth__chip--error,
.apl-auth__notice--error {
    --apl-auth-tone: var(--apc-color-error);
    --apl-auth-tone-container: var(--apc-color-error-container);
    --apl-auth-on-tone-container: var(--apc-color-on-error-container);
}

.apl-auth__icon--tertiary,
.apl-auth__chip--tertiary,
.apl-auth__notice--tertiary {
    --apl-auth-tone: var(--apc-color-tertiary);
    --apl-auth-tone-container: var(--apc-color-tertiary-container);
    --apl-auth-on-tone-container: var(--apc-color-on-tertiary-container);
}

/* classic: fondo del tono al 10 % con borde; md3: contenedor tonal del rol. */
.apl-auth__icon,
.apl-auth__chip,
.apl-auth__notice {
    --apl-auth-tone-bg: color-mix(in srgb, var(--apl-auth-tone) 10%, transparent);
    --apl-auth-tone-fg: var(--apl-auth-tone);
    --apl-auth-tone-border: color-mix(in srgb, var(--apl-auth-tone) 25%, transparent);
    border: var(--apc-border-width) solid var(--apl-auth-tone-border);
    background-color: var(--apl-auth-tone-bg);
    color: var(--apl-auth-tone-fg);
}

[data-apc-theme="md3"] .apl-auth__icon,
[data-apc-theme="md3"] .apl-auth__chip,
[data-apc-theme="md3"] .apl-auth__notice {
    --apl-auth-tone-bg: var(--apl-auth-tone-container);
    --apl-auth-tone-fg: var(--apl-auth-on-tone-container);
    --apl-auth-tone-border: transparent;
}

.apl-auth__icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    align-self: center;
    justify-content: center;
    box-sizing: border-box;
    width: var(--apl-auth-icon-box);
    height: var(--apl-auth-icon-box);
    border-radius: var(--apc-shape-corner-full);
}

.apl-auth__icon .material-symbols-outlined {
    font-size: var(--apl-auth-icon-size);
}

.apl-auth__chip {
    display: inline-flex;
    align-items: center;
    align-self: center;
    gap: var(--apc-space-2);
    box-sizing: border-box;
    max-width: 100%;
    min-height: var(--apc-space-8);
    padding: var(--apc-space-2) var(--apc-space-4);
    border-radius: var(--apc-shape-corner-sm);
    font-size: var(--apc-type-label-lg-size);
    line-height: var(--apc-type-label-lg-line-height);
    font-weight: var(--apc-type-label-lg-weight);
    overflow-wrap: anywhere;
}

.apl-auth__chip .material-symbols-outlined {
    font-size: var(--apc-icon-size-sm);
}

/* Aviso en línea (banner del formulario): icono + texto, alineado a la izquierda. */
.apl-auth__notice {
    display: flex;
    align-items: flex-start;
    gap: var(--apc-space-3);
    box-sizing: border-box;
    margin: 0;
    padding: var(--apc-space-4);
    border-radius: var(--apc-shape-corner-md);
    font-size: var(--apc-type-body-sm-size);
    line-height: var(--apc-type-body-sm-line-height);
    text-align: left;
}

.apl-auth__notice > .material-symbols-outlined {
    flex-shrink: 0;
    font-size: var(--apc-icon-size-sm);
}

.apl-auth__notice-body {
    display: flex;
    flex-direction: column;
    gap: var(--apc-space-2);
    min-width: 0;
}

.apl-auth__notice-title {
    margin: 0;
    font-size: var(--apc-type-label-lg-size);
    line-height: var(--apc-type-label-lg-line-height);
    font-weight: var(--apc-type-label-lg-weight);
}

.apl-auth__notice-text {
    margin: 0;
}

.apl-auth__notice strong {
    font-weight: var(--apc-type-title-sm-weight);
}

/* Formularios: columna de campos de autopyme_components (.apc-field-group). */
.apl-auth__form {
    display: flex;
    flex-direction: column;
    gap: var(--apc-space-5);
    margin: 0;
    text-align: left;
}

.apl-auth__optional {
    color: var(--apc-color-on-surface-variant);
    font-weight: var(--apc-type-body-sm-weight);
}

.apl-auth__password {
    position: relative;
}

.apl-auth__password .apc-field {
    padding-right: calc(var(--apc-touch-target) + var(--apc-space-2));
}

/* Clase repetida: gana a la posición relativa del botón de icono de md3 (0,2,0), que se carga después. */
.apl-auth__password-toggle.apl-auth__password-toggle.apc-icon-button {
    position: absolute;
    top: 50%;
    right: var(--apc-space-2);
    transform: translateY(-50%);
}

/* md3: la etiqueta va dentro del contenedor relleno; el botón se centra en todo el contenedor (56 / 48). */
[data-apc-theme="md3"] .apl-auth__password {
    position: static;
}

[data-apc-theme="md3"] .apl-auth .apc-field-group:has(.apl-auth__password) {
    position: relative;
}

[data-apc-theme="md3"] .apl-auth__password-toggle.apl-auth__password-toggle.apc-icon-button {
    z-index: 2; /* encima de la etiqueta en reposo, que cubre el contenedor (z-index 1 en field.css de md3) */
    top: calc(var(--apc-control-height) / 2);
}

/* Botones: los de autopyme_components (.apc-button) a todo el ancho, con el alto del tema. */
.apl-auth__btn-block {
    width: 100%;
    min-height: var(--apl-auth-btn-height);
}

/* md3: el botón mide --apc-button-height (40, o 36 en compacta) también donde el button.css de classic, que se
   carga siempre, le deja un mínimo de 40 («¿Has olvidado tu contraseña?», botones del asistente). */
[data-apc-theme="md3"] .apl-auth .apc-button {
    min-height: var(--apc-button-height);
}

/* Botón de texto con etiqueta larga (enlaces de «crear cuenta», «volver»): puede ocupar dos líneas. */
.apl-auth .apc-button.apl-auth__btn-wrap {
    height: auto;
    min-height: var(--apc-button-height);
    white-space: normal;
    text-align: center;
}

.apl-auth__actions {
    display: flex;
    flex-direction: column;
    gap: var(--apc-space-4);
}

.apl-auth__links {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: var(--apc-space-4);
    border-top: var(--apc-border-width) solid var(--apc-color-outline-variant);
}

/* Indicador de actividad en botones (sustituye a los relojes de arena y animaciones de utilidad). */
@keyframes apl-auth-spin {
    to {
        transform: rotate(360deg);
    }
}

.apl-auth__spin {
    animation: apl-auth-spin 1s linear infinite;
}

/* Lista de datos (tarjetas públicas y resumen del registro): etiqueta y valor por fila. */
.apl-auth__details {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: var(--apc-space-2) var(--apc-space-5);
    border: var(--apc-border-width) solid var(--apc-color-outline-variant);
    border-radius: var(--apc-shape-corner-md);
    background-color: var(--apc-color-surface-container);
    text-align: left;
}

/* Siempre en línea (etiqueta a la izquierda, valor a la derecha): un valor largo (un correo) baja de línea dentro
   de su columna en vez de apilar solo esa fila. */
.apl-auth__detail {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--apc-space-1) var(--apc-space-4);
    padding: var(--apc-space-3) 0;
    border-bottom: var(--apc-border-width) solid var(--apc-color-outline-variant);
}

.apl-auth__detail:last-child {
    border-bottom: 0;
}

.apl-auth__detail-label {
    flex: 0 1 auto;
    max-width: 45%;
    color: var(--apc-color-on-surface-variant);
    font-size: var(--apc-type-body-sm-size);
    line-height: var(--apc-type-body-sm-line-height);
}

.apl-auth__detail-value {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    color: var(--apc-color-on-surface);
    font-size: var(--apc-type-body-md-size);
    line-height: var(--apc-type-body-md-line-height);
    font-weight: var(--apc-type-title-sm-weight);
    text-align: right;
    overflow-wrap: anywhere;
}

.apl-auth__detail-value--accent {
    color: var(--apc-color-primary);
}

.apl-auth__eyebrow {
    margin: 0;
    color: var(--apc-color-primary);
    font-size: var(--apc-type-label-md-size);
    line-height: var(--apc-type-label-md-line-height);
    font-weight: var(--apc-type-label-md-weight);
    letter-spacing: var(--apc-type-label-md-tracking);
    text-transform: uppercase;
}

.apl-auth__hint {
    margin: 0;
    color: var(--apc-color-on-surface-variant);
    font-size: var(--apc-type-body-sm-size);
    line-height: var(--apc-type-body-sm-line-height);
}

/* --------------------------------------------------------------------------
   3. Login (P-LOGIN): panel de marca + panel de accesos
   - Vertical: franja de marca arriba y accesos debajo (md3 compact: a pantalla completa, sin tarjeta).
   - Horizontal (≥ 520 apaisado, salvo el simulador en vertical): pantalla partida a altura completa.
   -------------------------------------------------------------------------- */
.apl-login__viewport {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
}

.apl-login-main {
    justify-content: flex-start;
}

.apl-login-layout {
    --apl-login-hero-bg: linear-gradient(150deg, var(--apc-color-primary) 0%, color-mix(in srgb, var(--apc-color-primary) 55%, var(--apc-color-inverse-primary)) 45%, var(--apc-color-inverse-primary) 100%);
    --apl-login-hero-fg: var(--apc-color-on-primary);
    --apl-login-truck-max: calc(var(--apc-space-10) * 5); /* 240 */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    box-sizing: border-box;
    width: 100%;
    max-width: var(--apl-auth-card-max);
    margin: 0 auto;
    border-radius: var(--apl-auth-card-radius);
    box-shadow: var(--apl-auth-card-shadow);
}

/* classic oscuro: la misma franja azul con texto claro (primary es el azul claro en oscuro). */
[data-apc-mode="dark"] .apl-login-layout {
    --apl-login-hero-bg: linear-gradient(150deg, var(--apc-color-inverse-primary) 0%, color-mix(in srgb, var(--apc-color-inverse-primary) 55%, var(--apc-color-primary)) 45%, var(--apc-color-primary) 100%);
    --apl-login-hero-fg: var(--apc-color-on-primary-container);
}

/* md3: contenedor tonal primario (claro y oscuro). */
[data-apc-theme="md3"] .apl-login-layout {
    --apl-login-hero-bg: var(--apc-color-primary-container);
    --apl-login-hero-fg: var(--apc-color-on-primary-container);
}

@media (max-width: 599px) {
    [data-apc-theme="md3"] .apl-login-main {
        padding: 0;
    }

    [data-apc-theme="md3"] .apl-login-layout {
        --apl-login-truck-max: calc(var(--apc-space-10) * 3 + var(--apc-space-7)); /* 168 */
        flex: 1 1 auto;
        max-width: none;
    }
}

/* Panel de marca */
.apl-login-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    padding: var(--apc-space-6) var(--apc-space-6) var(--apc-space-5);
    border-radius: var(--apl-auth-card-radius) var(--apl-auth-card-radius) 0 0;
    background: var(--apl-login-hero-bg);
    color: var(--apl-login-hero-fg);
    text-align: center;
}

/* Trama de puntos sutil sobre el panel */
.apl-login-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(color-mix(in srgb, var(--apl-login-hero-fg) 18%, transparent) var(--apc-border-width), transparent calc(var(--apc-border-width) + var(--apc-space-1)));
    background-size: calc(var(--apc-space-6) + var(--apc-space-1)) calc(var(--apc-space-6) + var(--apc-space-1));
}

.apl-login-hero-text {
    position: relative;
}

.apl-login-hero-title {
    margin: 0;
    color: inherit;
    font-size: var(--apc-type-headline-sm-size);
    line-height: var(--apc-type-headline-sm-line-height);
    font-weight: var(--apc-type-headline-sm-weight);
}

.apl-login-hero-subtitle {
    max-width: 34ch;
    margin: var(--apc-space-3) auto 0;
    color: inherit;
    font-size: var(--apl-auth-text-size);
    line-height: var(--apl-auth-text-line);
    opacity: 0.9;
}

.apl-login-hero-list {
    display: none;
    margin: 0;
    padding: 0;
    list-style: none;
}

.apl-login-hero-list li {
    display: flex;
    align-items: center;
    gap: var(--apc-space-4);
    font-size: var(--apc-type-body-lg-size);
    line-height: var(--apc-type-body-lg-line-height);
}

.apl-login-hero-list .material-symbols-outlined {
    display: inline-grid;
    place-items: center;
    width: var(--apc-icon-size);
    height: var(--apc-icon-size);
    border-radius: var(--apc-shape-corner-full);
    background-color: color-mix(in srgb, var(--apl-login-hero-fg) 20%, transparent);
    font-size: var(--apc-type-label-lg-size);
}

.apl-login-hero-trial {
    display: none;
    margin: var(--apc-space-4) 0 0;
    font-size: var(--apc-type-label-lg-size);
    line-height: var(--apc-type-label-lg-line-height);
    font-weight: var(--apc-type-label-lg-weight);
}

.apl-login-hero-picture {
    position: relative;
    display: block;
    width: 100%;
}

.apl-login-truck-img {
    display: block;
    width: 66%;
    max-width: var(--apl-login-truck-max);
    height: auto;
    margin: var(--apc-space-4) auto 0;
    object-fit: contain;
    filter: drop-shadow(0 var(--apc-space-4) var(--apc-space-5) color-mix(in srgb, var(--apc-color-shadow) 28%, transparent));
}

/* Panel de accesos pegado al de marca */
.apl-login-card-container {
    display: flex;
    flex-direction: column;
    gap: var(--apc-space-5);
    box-sizing: border-box;
    width: 100%;
    padding: var(--apc-space-6) var(--apc-space-5) var(--apc-space-7);
    border-radius: 0 0 var(--apl-auth-card-radius) var(--apl-auth-card-radius);
    background-color: var(--apl-auth-card-bg);
    color: var(--apc-color-on-surface);
}

@media (max-width: 599px) {
    [data-apc-theme="md3"] .apl-login-card-container {
        flex: 1 1 auto;
    }
}

.apl-login__panel {
    display: flex;
    flex-direction: column;
    gap: var(--apc-space-5);
}

/* Botones de los métodos de acceso (Google, correo, huella): botón perfilado a todo el ancho. */
.apl-login__method {
    gap: var(--apc-space-4);
    padding-right: var(--apc-space-4);
    padding-left: var(--apc-space-4);
    border-color: var(--apc-color-outline);
    background-color: var(--apc-color-surface);
    color: var(--apc-color-on-surface);
    font-size: var(--apc-type-label-lg-size);
}

/* Etiqueta larga con letra grande (classic, escala de letra): baja de línea en vez de comerse el icono. */
.apl-auth .apc-button.apl-login__method {
    height: auto;
    min-height: var(--apl-auth-btn-height);
    white-space: normal;
}

.apl-login__method .material-symbols-outlined,
.apl-login__method-icon {
    flex-shrink: 0;
}

.apl-login__method-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: var(--apc-icon-size-sm);
    height: var(--apc-icon-size-sm);
}

.apl-login__method .material-symbols-outlined {
    margin: 0;
    color: var(--apc-color-primary);
    font-size: var(--apc-icon-size-sm);
}

.google-logo-svg {
    display: block;
    flex-shrink: 0;
    width: var(--apc-icon-size-sm);
    height: var(--apc-icon-size-sm);
}

.apl-login__method-error {
    margin: 0;
    color: var(--apc-color-error);
    font-size: var(--apc-type-body-sm-size);
    line-height: var(--apc-type-body-sm-line-height);
    text-align: center;
}

/* Cabecera del panel de correo: volver (botón de icono) + título */
.apl-login__panel-bar {
    display: flex;
    align-items: center;
    gap: var(--apc-space-2);
    margin: calc(var(--apc-space-3) * -1) 0 0 calc(var(--apc-space-3) * -1);
}

.apl-login__panel-title {
    margin: 0;
    color: var(--apc-color-on-surface);
    font-size: var(--apl-auth-subtitle-size);
    line-height: var(--apl-auth-subtitle-line);
    font-weight: var(--apl-auth-subtitle-weight);
}

/* Enlace «¿Has olvidado tu contraseña?» bajo la contraseña, a la derecha */
.apl-login__forgot {
    align-self: flex-end;
    margin-top: calc(var(--apc-space-3) * -1);
}

/* Información de la base de datos (solo en localhost) */
.apl-login__localhost {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    align-self: center;
    justify-content: center;
    gap: var(--apc-space-2) var(--apc-space-4);
    margin-top: var(--apc-space-3);
    padding: var(--apc-space-2) var(--apc-space-4);
    border-radius: var(--apc-shape-corner-md);
    background-color: var(--apc-color-surface-container-high);
    color: var(--apc-color-on-surface-variant);
    font-family: var(--apc-font-family-mono);
    font-size: var(--apc-type-label-md-size);
    line-height: var(--apc-type-label-md-line-height);
}

.apl-login__localhost span {
    display: inline-flex;
    align-items: center;
    gap: var(--apc-space-2);
}

.apl-login__localhost .material-symbols-outlined {
    font-size: var(--apc-type-label-lg-size);
}

/* Campos de acceso del panel de correo: envoltorio sin caja propia (los campos siguen en la columna del
   formulario); se oculta entero con el aviso de cuenta pendiente de activación. */
.apl-login__credentials {
    display: contents;
}

/* Cuenta pendiente de activación (Google o correo) */
.apl-login__pending {
    display: flex;
    flex-direction: column;
    gap: var(--apc-space-5);
    text-align: center;
}

/* Diálogo «Recuperar contraseña»: el de autopyme_components (.apc-dialog-*), a pantalla completa en móvil con
   md3 (apc-dialog--fullscreen-compact). Aquí solo se ordena su cuerpo. */
.apl-login__reset-dialog .apc-dialog-body {
    display: flex;
    flex-direction: column;
    gap: var(--apc-space-5);
    text-align: left;
}

.apl-login__reset-dialog .apc-dialog-text {
    margin: 0;
}

/* md3 compact (diálogo a pantalla completa): la acción de la cabecera es un botón de texto sin icono, como en
   M3, y el título puede ocupar dos líneas en vez de cortarse («Recuperar contras…»). */
@media (max-width: 599px) {
    [data-apc-theme="md3"] .apl-login__reset-dialog.apc-dialog--fullscreen-compact .apc-dialog-footer .apc-dialog-btn-primary .material-symbols-outlined {
        display: none;
    }

    [data-apc-theme="md3"] .apl-login__reset-dialog.apc-dialog--fullscreen-compact .apc-dialog-heading .apc-dialog-title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        white-space: normal;
    }
}

/* --------------------------------------------------------------------------
   3 bis. Login en horizontal: pantalla partida a altura completa
   -------------------------------------------------------------------------- */
@media (orientation: landscape) and (min-width: 520px) {
    body:not([data-sim-orientation="portrait"]) .apl-login-main {
        align-items: stretch;
        padding: 0;
    }

    body:not([data-sim-orientation="portrait"]) .apl-login-layout {
        flex: 1 1 auto;
        flex-direction: row;
        max-width: none;
        border-radius: 0;
        box-shadow: none;
    }

    body:not([data-sim-orientation="portrait"]) .apl-login-visual {
        flex: 1.15 1 0;
        align-items: flex-start;
        justify-content: center;
        padding: var(--apc-space-9) 6vw;
        border-radius: 0;
        text-align: left;
    }

    body:not([data-sim-orientation="portrait"]) .apl-login-visual::before {
        -webkit-mask-image: linear-gradient(90deg, transparent, currentColor 60%);
        mask-image: linear-gradient(90deg, transparent, currentColor 60%);
    }

    body:not([data-sim-orientation="portrait"]) .apl-login-hero-title {
        max-width: 16ch;
        font-size: var(--apc-type-display-sm-size);
        line-height: var(--apc-type-display-sm-line-height);
    }

    body:not([data-sim-orientation="portrait"]) .apl-login-hero-subtitle {
        max-width: 36ch;
        margin: var(--apc-space-5) 0 var(--apc-space-7);
        font-size: var(--apc-type-body-lg-size);
        line-height: var(--apc-type-body-lg-line-height);
    }

    body:not([data-sim-orientation="portrait"]) .apl-login-hero-list {
        display: grid;
        gap: var(--apc-space-4);
    }

    body:not([data-sim-orientation="portrait"]) .apl-login-hero-trial {
        display: block;
    }

    body:not([data-sim-orientation="portrait"]) .apl-login-truck-img {
        width: 85%;
        max-width: calc(var(--apc-space-10) * 11);
        max-height: 34vh;
        margin: var(--apc-space-8) 0 0;
    }

    body:not([data-sim-orientation="portrait"]) .apl-login-card-container {
        flex: 1 1 0;
        justify-content: center;
        overflow-y: auto;
        padding: var(--apc-space-9) var(--apc-space-8);
        border-radius: 0;
    }

    /* El contenido de accesos conserva un ancho cómodo centrado en su mitad */
    body:not([data-sim-orientation="portrait"]) .apl-login-card-container > * {
        flex-shrink: 0;
        box-sizing: border-box;
        width: 100%;
        max-width: calc(var(--apc-space-10) * 8 + var(--apc-space-5)); /* 400 */
        margin-right: auto;
        margin-left: auto;
    }
}

/* Teléfonos apaisados de poca altura: versión compacta */
@media (orientation: landscape) and (max-height: 480px) {
    .apl-login-visual {
        padding: var(--apc-space-5) var(--apc-space-7);
    }

    body:not([data-sim-orientation="portrait"]) .apl-login-hero-title {
        font-size: var(--apc-type-title-lg-size);
        line-height: var(--apc-type-title-lg-line-height);
    }

    body:not([data-sim-orientation="portrait"]) .apl-login-hero-subtitle,
    body:not([data-sim-orientation="portrait"]) .apl-login-hero-list,
    body:not([data-sim-orientation="portrait"]) .apl-login-hero-trial {
        display: none;
    }

    body:not([data-sim-orientation="portrait"]) .apl-login-truck-img {
        width: 80%;
        max-height: 42vh;
        margin-top: var(--apc-space-4);
    }

    body:not([data-sim-orientation="portrait"]) .apl-login-card-container {
        justify-content: flex-start;
        padding: var(--apc-space-4) var(--apc-space-6);
    }
}

/* --------------------------------------------------------------------------
   4. Registro (P-REG-0…4 y final): asistente con indicador de progreso lineal y barra inferior
   -------------------------------------------------------------------------- */
.apl-reg {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    min-height: 0;
}

.apl-reg__inner {
    box-sizing: border-box;
    width: 100%;
    max-width: calc(var(--apc-space-10) * 14); /* 672 */
    margin: 0 auto;
}

.apl-reg__head {
    flex-shrink: 0;
    box-sizing: border-box;
    width: 100%;
    padding: var(--apc-space-4) var(--apl-auth-pad) var(--apc-space-4);
    border-bottom: var(--apc-border-width) solid var(--apl-auth-appbar-border);
    background-color: var(--apl-auth-appbar-bg);
}

.apl-reg__step-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--apc-space-1) var(--apc-space-3);
    margin-bottom: var(--apc-space-4);
}

.apl-reg__step-badge {
    color: var(--apc-color-primary);
    font-size: var(--apc-type-label-md-size);
    line-height: var(--apc-type-label-md-line-height);
    font-weight: var(--apc-type-label-md-weight);
    letter-spacing: var(--apc-type-label-md-tracking);
    text-transform: uppercase;
}

.apl-reg__step-title {
    color: var(--apc-color-on-surface);
    font-size: var(--apc-type-title-sm-size);
    line-height: var(--apc-type-title-sm-line-height);
    font-weight: var(--apc-type-title-sm-weight);
}

/* Indicador de progreso lineal de M3 (determinado): pista de 4 y avance en primary según data-step. */
.apl-reg__progress {
    --apl-reg-progress: 25%;
    position: relative;
    overflow: hidden;
    height: var(--apc-space-2);
    border-radius: var(--apc-shape-corner-full);
    background-color: var(--apc-color-surface-container-highest);
}

.apl-reg__progress[data-step="2"] {
    --apl-reg-progress: 50%;
}

.apl-reg__progress[data-step="3"] {
    --apl-reg-progress: 75%;
}

.apl-reg__progress[data-step="4"] {
    --apl-reg-progress: 100%;
}

.apl-reg__progress-indicator {
    display: block;
    width: var(--apl-reg-progress);
    height: 100%;
    border-radius: var(--apc-shape-corner-full);
    background-color: var(--apc-color-primary);
    transition: width var(--apc-motion-duration-medium) var(--apc-motion-easing-emphasized-decelerate);
}

.apl-reg__banner {
    flex-shrink: 0;
    box-sizing: border-box;
    width: 100%;
    padding: var(--apc-space-4) var(--apl-auth-pad) 0;
}

.apl-reg__body {
    flex: 1 1 auto;
    overflow-y: auto;
    box-sizing: border-box;
    width: 100%;
    padding: var(--apc-space-5) var(--apl-auth-pad) var(--apc-space-6);
}

.apl-reg__pane {
    display: flex;
    flex-direction: column;
    gap: var(--apc-space-5);
}

.apl-reg__pane-head {
    display: flex;
    flex-direction: column;
    gap: var(--apc-space-2);
}

.apl-reg__pane-title {
    margin: 0;
    color: var(--apc-color-on-surface);
    font-size: var(--apl-auth-title-size);
    line-height: var(--apl-auth-title-line);
    font-weight: var(--apl-auth-title-weight);
}

.apl-reg__fields {
    display: flex;
    flex-direction: column;
    gap: var(--apc-space-5);
}

/* Paso 1: tarjetas de tipo de empresa (opción seleccionable; al elegir, avanza). */
.apl-reg__types {
    display: grid;
    gap: var(--apc-space-4);
}

.apl-reg__type-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--apc-space-5);
    padding: var(--apc-space-5);
    border: var(--apc-border-width) solid var(--apc-color-outline);
    border-radius: var(--apc-shape-corner-lg);
    background-color: var(--apc-color-surface);
    color: var(--apc-color-on-surface);
    box-shadow: var(--apc-elevation-1);
    cursor: pointer;
    user-select: none;
    transition: border-color var(--apc-motion-duration-short) var(--apc-motion-easing-standard),
                background-color var(--apc-motion-duration-short) var(--apc-motion-easing-standard);
}

[data-apc-theme="md3"] .apl-reg__type-card {
    border-color: var(--apc-color-outline-variant);
    border-radius: var(--apc-shape-corner-md);
    background-color: var(--apc-color-surface-container-low);
    box-shadow: none;
}

.apl-reg__type-card:hover {
    border-color: var(--apc-color-primary);
}

[data-apc-theme="md3"] .apl-reg__type-card:hover {
    background-color: color-mix(in srgb, var(--apc-color-on-surface) calc(var(--apc-state-hover-opacity) * 100%), var(--apc-color-surface-container-low));
}

.apl-reg__type-card:has(input:focus-visible) {
    outline: var(--apc-focus-ring-width) solid var(--apc-focus-ring-color);
    outline-offset: var(--apc-focus-ring-offset);
}

.apl-reg__type-card:has(input:checked),
.apl-reg__type-card.is-selected,
[data-apc-theme="md3"] .apl-reg__type-card:has(input:checked),
[data-apc-theme="md3"] .apl-reg__type-card.is-selected {
    border-color: var(--apc-color-primary);
    background-color: var(--apc-color-secondary-container);
    color: var(--apc-color-on-secondary-container);
}

.apl-reg__type-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: var(--apc-space-10);
    height: var(--apc-space-10);
    border-radius: var(--apc-shape-corner-md);
    background-color: var(--apc-color-primary-container);
    color: var(--apc-color-on-primary-container);
}

.apl-reg__type-icon--shipper {
    background-color: var(--apc-color-tertiary-container);
    color: var(--apc-color-on-tertiary-container);
}

.apl-reg__type-icon .material-symbols-outlined {
    font-size: var(--apc-icon-size);
}

.apl-reg__type-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--apc-space-2);
    min-width: 0;
}

.apl-reg__type-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--apc-space-3);
}

.apl-reg__type-title {
    font-size: var(--apl-auth-subtitle-size);
    line-height: var(--apl-auth-subtitle-line);
    font-weight: var(--apl-auth-subtitle-weight);
}

.apl-reg__type-tag {
    display: inline-flex;
    align-items: center;
    padding: 0 var(--apc-space-3);
    border: var(--apc-border-width) solid var(--apc-color-outline-variant);
    border-radius: var(--apc-shape-corner-sm);
    color: var(--apc-color-on-surface-variant);
    font-size: var(--apc-type-label-md-size);
    line-height: var(--apc-type-label-md-line-height);
    font-weight: var(--apc-type-label-md-weight);
}

.apl-reg__type-desc {
    color: var(--apc-color-on-surface-variant);
    font-size: var(--apc-type-body-sm-size);
    line-height: var(--apc-type-body-sm-line-height);
}

/* Entrada de radio oculta pero accesible por teclado (tarjetas y botón segmentado). */
.apl-reg__radio {
    position: absolute;
    width: var(--apc-border-width);
    height: var(--apc-border-width);
    margin: 0;
    overflow: hidden;
    clip-path: inset(50%);
    opacity: 0;
}

/* Paso 3: «¿datos diferentes?» como botón segmentado de M3 (dos opciones, alto 40, marca de selección). */
.apl-reg__segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    border: var(--apc-border-width) solid var(--apc-color-outline);
    border-radius: var(--apc-shape-corner-full);
}

.apl-reg__segment {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--apc-space-3);
    box-sizing: border-box;
    min-height: var(--apc-button-height);
    padding: var(--apc-space-2) var(--apc-space-4);
    color: var(--apc-color-on-surface);
    font-size: var(--apc-type-label-lg-size);
    line-height: var(--apc-type-label-lg-line-height);
    font-weight: var(--apc-type-label-lg-weight);
    text-align: center;
    cursor: pointer;
    user-select: none;
}

.apl-reg__segment + .apl-reg__segment {
    border-left: var(--apc-border-width) solid var(--apc-color-outline);
}

.apl-reg__segment:hover {
    background-color: color-mix(in srgb, var(--apc-color-on-surface) calc(var(--apc-state-hover-opacity) * 100%), transparent);
}

.apl-reg__segment:has(input:focus-visible) {
    outline: var(--apc-focus-ring-width) solid var(--apc-focus-ring-color);
    outline-offset: calc(var(--apc-focus-ring-width) * -1);
}

.apl-reg__segment-check {
    display: none;
    font-size: var(--apc-icon-size-sm);
}

.apl-reg__segment:has(input:checked),
.apl-reg__segment.is-selected {
    background-color: var(--apc-color-secondary-container);
    color: var(--apc-color-on-secondary-container);
}

.apl-reg__segment:has(input:checked) .apl-reg__segment-check,
.apl-reg__segment.is-selected .apl-reg__segment-check {
    display: inline-block;
}

/* NIF / CIF: el valor en mayúsculas (lo escribe así el JS); el texto de ejemplo, tal cual. */
.apl-reg__upper {
    text-transform: uppercase;
}

.apl-reg__upper::placeholder {
    text-transform: none;
}

/* Filas de la empresa en el resumen: forman parte de la misma lista. */
.apl-reg__summary-rows {
    display: contents;
}

/* Tino (IA) bajo el CIF: botón y aviso del resultado */
.apl-reg__ai-root {
    margin-top: var(--apc-space-3);
}

.apl-reg__ai-msg {
    margin: var(--apc-space-2) 0 0;
    padding: 0 var(--apc-field-padding-x);
    color: var(--apc-color-error);
    font-size: var(--apc-type-body-sm-size);
    line-height: var(--apc-type-body-sm-line-height);
}

.apl-reg__ai-msg.is-success {
    color: var(--apc-color-success);
}

/* Pantalla final */
.apl-reg__success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--apl-auth-gap);
    padding: var(--apc-space-7) 0;
    text-align: center;
}

.apl-reg__success .apl-auth__text {
    max-width: calc(var(--apc-space-10) * 8);
}

/* Con el asistente en pantalla, la página mide exactamente la ventana: solo se desplaza el cuerpo del paso y la
   barra de acciones queda siempre visible abajo, también en horizontal (antes, con 844 × 390, «Siguiente»
   quedaba fuera de la pantalla al final del formulario). */
.apl-auth:has(> .apl-reg:not(.hidden)) {
    height: 100vh;
    height: 100dvh;
}

/* Barra inferior del asistente: Cancelar a la izquierda; Atrás y Siguiente / Confirmar a la derecha. */
.apl-reg__footer {
    flex-shrink: 0;
    box-sizing: border-box;
    width: 100%;
    padding: var(--apc-space-4) var(--apl-auth-pad) calc(var(--apc-space-4) + env(safe-area-inset-bottom, 0));
    border-top: var(--apc-border-width) solid var(--apc-color-outline-variant);
    background-color: var(--apl-auth-appbar-bg);
}

[data-apc-theme="md3"] .apl-reg__footer {
    border-top-color: transparent;
    background-color: var(--apc-color-surface-container);
}

/* Si no caben en una fila (paso 4 con «Confirmar registro» a 360-390 px de ancho, QA REG-09), Atrás y
   Confirmar pasan a una segunda fila alineada a la derecha: nunca se desbordan ni hay scroll horizontal. */
.apl-reg__footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--apc-space-3);
}

.apl-reg__footer-end {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--apc-space-3);
    min-width: 0;
    max-width: 100%;
    margin-left: auto;
}

.apl-reg__footer-end .apc-button {
    max-width: 100%;
}

/* Declaración de quien da de alta la empresa (paso 4): casilla y texto en una fila. */
.apl-reg__declaration {
    display: flex;
    align-items: flex-start;
    gap: var(--apc-space-3);
    cursor: pointer;
    color: var(--apc-color-on-surface);
}

.apl-reg__declaration-check {
    flex-shrink: 0;
    width: calc(var(--apc-space-5) + var(--apc-space-1));
    height: calc(var(--apc-space-5) + var(--apc-space-1));
    margin: 0;
    accent-color: var(--apc-color-primary);
}

.apl-reg__declaration-check.is-invalid {
    outline: var(--apc-border-width) solid var(--apc-color-error);
    outline-offset: var(--apc-border-width);
}

/* Móvil: «Atrás» solo con la flecha (el nombre queda para el lector de pantalla), para que quepan Cancelar,
   Atrás y Confirmar registro en una fila. */
@media (max-width: 599px) {
    .apl-reg__footer .apl-reg__prev.apc-button {
        padding-right: var(--apc-space-4);
        padding-left: var(--apc-space-4);
    }

    .apl-reg__footer .apl-reg__prev .material-symbols-outlined {
        margin: 0;
    }

    .apl-reg__prev-label {
        position: absolute;
        width: var(--apc-border-width);
        height: var(--apc-border-width);
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

/* Asistente en pantallas bajas (teléfono apaisado, 844×390; QA md3 A1-R2-06): más alto útil para el
   formulario. Una sola cabecera compacta (la del paso con su progreso; la barra de la marca se oculta mientras el
   asistente está a la vista), sin el subtítulo instructivo del paso y con menos relleno en la cabecera, el
   cuerpo y la barra de acciones, que sigue fija abajo. */
@media (orientation: landscape) and (max-height: 480px) {
    body:not([data-sim-orientation="portrait"]).apl-auth:has(> .apl-reg:not(.hidden)) > .apl-auth__appbar {
        display: none;
    }

    body:not([data-sim-orientation="portrait"]) .apl-reg__head {
        padding-top: var(--apc-space-2);
        padding-bottom: var(--apc-space-3);
    }

    body:not([data-sim-orientation="portrait"]) .apl-reg__step-line {
        margin-bottom: var(--apc-space-2);
    }

    body:not([data-sim-orientation="portrait"]) .apl-reg__banner {
        padding-top: var(--apc-space-2);
    }

    body:not([data-sim-orientation="portrait"]) .apl-reg__body {
        padding-top: var(--apc-space-3);
        padding-bottom: var(--apc-space-4);
    }

    body:not([data-sim-orientation="portrait"]) .apl-reg__pane {
        gap: var(--apc-space-4);
    }

    body:not([data-sim-orientation="portrait"]) .apl-reg__pane-head .apl-auth__text--instructive {
        display: none;
    }

    body:not([data-sim-orientation="portrait"]) .apl-reg__footer {
        padding-top: var(--apc-space-2);
        padding-bottom: calc(var(--apc-space-2) + env(safe-area-inset-bottom, 0));
    }
}

/* --------------------------------------------------------------------------
   5. Ocultos: la clase «hidden» que usa el JS de estas pantallas gana a los display de las clases de arriba y
   de autopyme_components (cargadas después, con especificidad 0,2,0).
   -------------------------------------------------------------------------- */
:root .apl-auth .hidden {
    display: none;
}

/* Tamaño de letra raíz del tema classic según la escala elegida (apl_fontsize_manager.js marca
   <html data-apl-font-scale>; mismos valores que apl_shell.css). Con md3 la escala va en --apc-font-scale. */
:root:not([data-apc-theme="md3"])[data-apl-font-scale="small"] { font-size: 105%; }
:root:not([data-apc-theme="md3"])[data-apl-font-scale="normal"] { font-size: 120%; }
:root:not([data-apc-theme="md3"])[data-apl-font-scale="large"] { font-size: 140%; }
:root:not([data-apc-theme="md3"])[data-apl-font-scale="xlarge"] { font-size: 175%; }
