/* Asistente de alta del sandbox (Portal Cliente), direccion D (skill ecuafact-marca). Solo tokens de
   Styles/app.css; sin estilos en linea. Se carga despues de tailwind.css, asi que estas reglas mandan sobre las
   de la hoja de acceso. Los botones son los del portal (.btn-primary y .btn-ghost). */
.sandbox-body {
    min-height: 100vh;
}

/* El paso a paso va dentro de la hoja blanca (sobre el marino no se leeria). */
.sandbox-body .login-split > .login-brand {
    flex-basis: auto;
}

.sandbox-wizard {
    width: 100%;
    max-width: 720px;
    padding: 1.5rem 1.25rem;
    color: var(--ink);
    background: var(--surface);
    border-radius: var(--r-panel);
    box-shadow: var(--overlay);
}

.sandbox-wizard :focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* La tarjeta del asistente ocupa todo su ancho y se alinea con el stepper. */
.sandbox-wizard .login-card {
    max-width: none;
    padding: 1rem 0 0;
    background: transparent;
    box-shadow: none;
}

@media (min-width: 640px) {
    .sandbox-wizard {
        padding: 2.5rem 2.75rem;
    }
}

/* Paso 1: campos cortos en dos columnas desde 640px; la razon social ocupa la fila completa. */
.wizard-campos {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem 1.25rem;
}

@media (min-width: 640px) {
    .wizard-campos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wizard-campos__ancho {
        grid-column: 1 / -1;
    }
}

/* Stepper */
.stepper {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.stepper__item {
    flex: 1;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--ink-3);
}

.stepper__link,
.stepper__static {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    border-radius: var(--r-ctl);
}

.stepper__dot {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--ink-2);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    transition: border-color 120ms var(--ease-out), background-color 120ms var(--ease-out), color 120ms var(--ease-out);
}

.stepper__item--done .stepper__dot {
    background: var(--action);
    border-color: var(--action);
    color: var(--on-action);
}

/* Paso actual: seleccion de D (sin halo). */
.stepper__item--current .stepper__dot {
    background: var(--sel-bg);
    border: 2px solid var(--action);
    color: var(--sel-ink);
}

.stepper__item--done .stepper__label {
    color: var(--ink-2);
    font-weight: 600;
}

.stepper__item--current .stepper__label {
    color: var(--ink);
    font-weight: 600;
}

.stepper__count {
    margin: 0 0 16px;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--ink-3);
}

/* Resumen de errores (enfocable): par de estado de rechazo, sin borde de color. */
.resumen-errores {
    margin: 0 0 16px;
    padding: 12px 16px;
    background: var(--err-bg);
    border-radius: var(--r-ctl);
    color: var(--err);
    font-size: 0.875rem;
}

.resumen-errores:focus {
    outline: 2px solid var(--err);
    outline-offset: 2px;
}

.resumen-errores h2 {
    margin: 0 0 8px;
    font-size: 0.9375rem;
    font-weight: 600;
}

.resumen-errores ul {
    margin: 0;
    padding-left: 18px;
}

.campo-error {
    display: block;
    margin-top: 4px;
    font-size: 0.8125rem;
    color: var(--err);
}

/* Aviso de exito: par de estado autorizado, sin borde de color. */
.aviso-ok {
    margin: 0 0 16px;
    padding: 12px 16px;
    background: var(--ok-bg);
    border-radius: var(--r-ctl);
    color: var(--ok);
    font-size: 0.875rem;
}

.aviso-ok h2 {
    margin: 0 0 6px;
    font-size: 0.9375rem;
    font-weight: 600;
}

.aviso-ok p {
    margin: 0;
}

/* Acciones del paso */
.wizard-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.wizard-actions .btn-primary,
.wizard-actions .btn-ghost {
    flex: 1;
    min-height: 2.75rem;
    padding-block: 0;
}

.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Resumen del emisor (contexto en pasos 2+): superficie 2 con linea de 1 px. */
.emisor-resumen {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    border-radius: var(--r-ctl);
    font-size: 0.875rem;
    color: var(--ink-2);
}

.emisor-resumen strong {
    color: var(--ink);
}

@media (max-width: 640px) {
    .stepper {
        gap: 4px;
    }

    .stepper__dot {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .stepper__label {
        font-size: 0.75rem;
    }

    .wizard-actions {
        flex-direction: column-reverse;
    }

    .wizard-actions .btn-primary,
    .wizard-actions .btn-ghost {
        width: 100%;
    }
}

/* Correo confirmado (portal unico): glifo de estado centrado antes de crear la cuenta. */
.confirmado-icono {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 4px auto 16px;
    border-radius: 999px;
    background: var(--ok-bg);
    color: var(--ok);
    font-size: 32px;
}

.confirmado-acciones {
    justify-content: center;
}

/* El boton crea la cuenta: debe ser lo mas visible de la pantalla. */
.confirmado-acciones .btn-continuar {
    width: 100%;
    max-width: 320px;
    min-height: 48px;
    justify-content: center;
    font-size: 1rem;
}

/* API Key mostrada una sola vez al crear la cuenta (portal unico), con el boton de copiar dentro del campo. */
.api-key-campo {
    position: relative;
    margin: 8px 0;
}

.api-key-campo .api-key-una-vez {
    margin: 0;
    padding-right: 52px;
}

.api-key-copiar {
    position: absolute;
    top: 50%;
    right: 2px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    transform: translateY(-50%);
    border: 0;
    border-radius: var(--r-ctl);
    background: transparent;
    color: var(--ink);
    font-size: 18px;
    cursor: pointer;
}

.api-key-copiar:hover {
    background: var(--surface-2);
}

.api-key-copiar:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.api-key-una-vez {
    display: block;
    min-height: 48px;
    margin: 8px 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    background: var(--code-bg);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    overflow-wrap: anywhere;
    user-select: all;
}
