/* Stepper */
.auth-stepper {
    margin-bottom: 2.5rem;
}

.auth-stepper__track {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    gap: 0.5rem;
}

.auth-stepper__track::before {
    content: "";
    position: absolute;
    top: 1.6rem;
    left: 10%;
    right: 10%;
    height: 3px;
    background: var(--color-gris);
    z-index: 0;
}

.auth-stepper__progress {
    position: absolute;
    top: 1.6rem;
    left: 10%;
    height: 3px;
    width: 0;
    background: var(--color-amarillo);
    z-index: 1;
    transition: width 0.45s ease;
}

.auth-stepper__step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

.auth-stepper__bullet {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    border: 2px solid var(--color-gris);
    background: var(--color-blanco);
    color: var(--color-parrafo);
    transition: all 0.35s ease;
}

.auth-stepper__label {
    font-size: 1.2rem;
    color: var(--color-parrafo);
    line-height: 1.3;
    max-width: 9rem;
    transition: color 0.35s ease;
}

.auth-stepper__step.is-active .auth-stepper__bullet {
    border-color: var(--color-amarillo);
    background: var(--color-amarillo);
    color: var(--color-negro);
    transform: scale(1.08);
}

.auth-stepper__step.is-active .auth-stepper__label {
    color: var(--color-negro);
    font-weight: 700;
}

.auth-stepper__step.is-done .auth-stepper__bullet {
    border-color: var(--color-amarillo);
    background: var(--color-amarillo);
    color: var(--color-negro);
}

.auth-stepper__step.is-done .auth-stepper__label {
    color: var(--color-negro);
}

/* Step panels */
.auth-paso {
    animation: authStepEnter 0.4s ease forwards;
}

.auth-paso.is-leaving {
    animation: authStepLeave 0.25s ease forwards;
}

@keyframes authStepEnter {
    from {
        opacity: 0;
        transform: translateY(1.2rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes authStepLeave {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-0.8rem);
    }
}

/* Tipo cuenta */
.auth-tipo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.auth-tipo-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 1.8rem 1rem;
    border: 2px solid var(--color-gris);
    border-radius: 1.2rem;
    background: var(--color-blanco);
    font-family: "Ubuntu", sans-serif;
    cursor: pointer;
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.auth-tipo-btn:hover {
    border-color: var(--color-amarillo);
    transform: translateY(-2px);
}

.auth-tipo-btn.is-selected {
    border-color: var(--color-amarillo);
    background: #fff9e6;
    box-shadow: 0 0.6rem 1.6rem rgba(245, 184, 0, 0.2);
}

.auth-tipo-btn__icon {
    width: 3.2rem;
    height: 3.2rem;
}

.auth-tipo-btn__titulo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-negro);
}

.auth-tipo-btn__desc {
    font-size: 1.2rem;
    color: var(--color-parrafo);
}

/* Identity card */
.auth-id-card {
    border: 1px solid var(--color-gris);
    border-radius: 1.2rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
    animation: authStepEnter 0.4s ease;
}

.auth-id-card__header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.2rem 1.4rem;
    background: #ecfdf3;
    border-bottom: 1px solid #bbf7d0;
}

.auth-id-card__header img {
    width: 2rem;
    height: 2rem;
}

.auth-id-card__header-titulo {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #027a48;
}

.auth-id-card__body {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-id-card__row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.auth-id-card__label {
    font-size: 1.2rem;
    color: var(--color-parrafo);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.auth-id-card__valor {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-negro);
    word-break: break-word;
}

.auth-id-card__acciones {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.auth-id-card__btn-secundario {
    display: block;
    width: 100%;
    padding: 1rem;
    border: none;
    background: none;
    color: var(--color-parrafo);
    font-family: "Ubuntu", sans-serif;
    font-size: 1.3rem;
    text-decoration: underline;
    cursor: pointer;
}

/* Overlay */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(23, 13, 11, 0.62);
    backdrop-filter: blur(2px);
    animation: authOverlayIn 0.25s ease;
}

.auth-overlay__panel {
    width: 100%;
    max-width: 36rem;
    background: var(--color-blanco);
    border-radius: 1.6rem;
    padding: 2.4rem 2rem;
    text-align: center;
    box-shadow: 0 1.6rem 4rem rgba(0, 0, 0, 0.2);
}

.auth-overlay__spinner {
    width: 4.8rem;
    height: 4.8rem;
    margin: 0 auto 1.6rem;
    border: 4px solid var(--color-gris);
    border-top-color: var(--color-amarillo);
    border-radius: 50%;
    animation: authSpin 0.8s linear infinite;
}

.auth-overlay__titulo {
    margin: 0 0 0.6rem;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-negro);
}

.auth-overlay__subtitulo {
    margin: 0;
    font-size: 1.4rem;
    color: var(--color-parrafo);
}

body.auth-overlay-open {
    overflow: hidden;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

@keyframes authOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Alerts & utilities */
.auth-steps {
    display: none;
}

.auth-alerta {
    padding: 1rem 1.2rem;
    border-radius: 1rem;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    animation: authStepEnter 0.3s ease;
}

.auth-alerta--error {
    background: #fdecea;
    color: #b42318;
}

.auth-alerta--ok {
    background: #ecfdf3;
    color: #027a48;
}

.auth-alerta--info {
    background: #fff9e6;
    color: var(--color-negro);
}

.auth-hidden {
    display: none !important;
}

.fondo-login--registro {
    min-height: 100vh;
}

.login__boton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-input-codigo {
    letter-spacing: 0.4em;
    text-align: center;
    font-size: 2rem !important;
    font-weight: 700;
}

@media (max-width: 520px) {
    .auth-tipo-grid {
        grid-template-columns: 1fr;
    }

    .auth-stepper__label {
        font-size: 1rem;
        max-width: 7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-paso,
    .auth-id-card,
    .auth-alerta,
    .auth-overlay,
    .auth-stepper__bullet,
    .auth-stepper__progress,
    .auth-tipo-btn {
        animation: none !important;
        transition: none !important;
    }
}
