/* ============================================================
   EXITUS / PORTAL FLOW — Motion & Microinteractions
   Exitus Orbit, Panel Morph, Micro-Nudge y Reduced Motion.
   ============================================================ */

/* ── 01. EXITUS ORBIT DYNAMICS ── */
.orbit-svg {
    transform-origin: center center;
    animation: orbitPassiveDrift 45s linear infinite;
}

@keyframes orbitPassiveDrift {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Estado Identity (Foco en Usuario / DNI) */
[data-access-state="identity"] .orbit-arc-1 {
    stroke: rgba(245, 181, 10, 0.45);
    stroke-width: 2;
}

[data-access-state="identity"] .orbit-highlight-1 {
    opacity: 0.9;
    stroke-dashoffset: -40;
}

/* Estado Credential (Foco en Contraseña) */
[data-access-state="credential"] .orbit-arc-1,
[data-access-state="credential"] .orbit-arc-2 {
    stroke: rgba(245, 181, 10, 0.55);
    stroke-width: 2;
}

[data-access-state="credential"] .orbit-highlight-2 {
    opacity: 0.95;
    stroke-dashoffset: -80;
}

/* Estado Ready (Ambos campos llenos y listos) */
[data-access-state="ready"] .orbit-arc {
    stroke: rgba(245, 181, 10, 0.35);
    stroke-width: 1.8;
}

[data-access-state="ready"] .orbit-arc-highlight {
    opacity: 1;
    animation: orbitReadySweep 3.2s ease-in-out infinite alternate;
}

@keyframes orbitReadySweep {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -320;
    }
}

[data-access-state="ready"] .btn-submit {
    box-shadow: 0 10px 28px -2px rgba(245, 181, 10, 0.55);
}

/* ── 02. SCANNING & PROGRESS AUTH ── */
.cyber-scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--exitus-yellow), transparent);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

.is-scanning .cyber-scanner-line {
    opacity: 1;
    animation: scanLine 1.6s ease-in-out infinite;
}

@keyframes scanLine {
    0% {
        top: 0%;
        opacity: 0;
    }
    30%, 70% {
        opacity: 1;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* ── 03. MICRO-NUDGE ERROR (Sobrio, 2px una sola vez) ── */
.shake-card {
    animation: microNudge 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes microNudge {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2.5px);
    }
    50% {
        transform: translateX(2.5px);
    }
    75% {
        transform: translateX(-1px);
    }
}

/* ── 04. PANEL MORPH (Login <-> Recovery) ── */
.access-panel-morph-wrap {
    transition: min-height var(--motion-panel) var(--ease-interface);
}

/* ── 05. PREFERS-REDUCED-MOTION ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .portal-flow-bg {
        animation: none !important;
        transform: none !important;
    }

    .orbit-svg {
        animation: none !important;
        transform: none !important;
    }

    .btn-submit.btn-loading .progress-trace {
        animation: none !important;
        width: 100% !important;
        opacity: 0.7 !important;
    }

    body[data-booting="true"] .skeleton-placeholder::after {
        animation: none !important;
    }
}