/* Login y páginas de autenticación — animaciones */

.auth-page {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 55%, #059a9a 100%);
    background-size: 200% 200%;
    animation: authBgShift 12s ease infinite;
}

.auth-bg-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.auth-bg-shapes::before,
.auth-bg-shapes::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
    animation: authOrbFloat 8s ease-in-out infinite;
}

.auth-bg-shapes::before {
    width: 280px;
    height: 280px;
    top: -80px;
    right: -60px;
    background: rgba(255, 255, 255, 0.25);
}

.auth-bg-shapes::after {
    width: 220px;
    height: 220px;
    bottom: -70px;
    left: -50px;
    background: rgba(0, 0, 0, 0.12);
    animation-delay: -4s;
}

.auth-card {
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    animation: authCardIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-animate-item {
    animation: authFadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--auth-delay, 0) * 0.08s);
}

/* Logo tech (login) */
.logo-tech-wrap {
    position: relative;
    display: inline-flex;
}

.auth-logo .logo-tech-auth {
    margin-bottom: 0.85rem;
}

.logo-tech-auth.logo-tech-wrap {
    border-radius: 14px;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary), transparent 40%, var(--primary-dark), transparent 70%, var(--primary));
    background-size: 300% 300%;
    animation: authLogoBorderFlow 5s linear infinite;
}

.logo-tech-auth .logo-tech-inner {
    position: relative;
    z-index: 1;
    padding: 0.55rem 0.95rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(30, 208, 213, 0.4);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 4px 18px rgba(0, 0, 0, 0.08),
        0 0 20px rgba(30, 208, 213, 0.12);
    transition: box-shadow 0.3s, border-color 0.3s;
}

.logo-tech-auth .logo-tech-ring {
    position: absolute;
    inset: -4px;
    border-radius: 14px;
    border: 1px solid rgba(30, 208, 213, 0.28);
    animation: authLogoRingPulse 3s ease-in-out infinite;
    pointer-events: none;
}

.logo-tech-auth .logo-tech-scan {
    position: absolute;
    inset: 2px;
    border-radius: 11px;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.logo-tech-auth .logo-tech-scan::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 45%;
    background: linear-gradient(180deg, transparent, rgba(30, 208, 213, 0.14), transparent);
    animation: authLogoScan 3.2s ease-in-out infinite;
}

.logo-tech-auth .auth-logo-img,
.logo-tech-auth .logo-float {
    max-height: 48px;
    max-width: 180px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    animation: authLogoFloat 4.5s ease-in-out infinite;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08)) drop-shadow(0 0 10px rgba(30, 208, 213, 0.25));
}

.logo-tech-auth.logo-tech-wrap:hover .logo-tech-inner {
    border-color: rgba(30, 208, 213, 0.65);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 1),
        0 8px 24px rgba(0, 0, 0, 0.1),
        0 0 28px rgba(30, 208, 213, 0.22);
}

.logo-tech-auth .logo-pcb-layer,
.logo-tech-auth .logo-pcb-vert {
    position: absolute;
    pointer-events: none;
    z-index: 4;
}

.logo-tech-auth .logo-pcb-layer {
    inset: -6px;
    border-radius: 14px;
}

.logo-tech-auth .logo-pcb-layer::before,
.logo-tech-auth .logo-pcb-layer::after {
    content: '';
    position: absolute;
    height: 2px;
    left: 14%;
    right: 14%;
    background: linear-gradient(90deg, transparent, #00e8ff, var(--primary), #00e8ff, transparent);
    background-size: 220% 100%;
    animation: authPcbFlow 2.2s linear infinite;
    opacity: 0.75;
}

.logo-tech-auth .logo-pcb-layer::before { top: 0; }
.logo-tech-auth .logo-pcb-layer::after {
    bottom: 0;
    animation-delay: 0.55s;
}

.logo-tech-auth .logo-pcb-vert {
    inset: -6px;
}

.logo-tech-auth .logo-pcb-vert::before,
.logo-tech-auth .logo-pcb-vert::after {
    content: '';
    position: absolute;
    width: 2px;
    top: 20%;
    bottom: 20%;
    background: linear-gradient(180deg, transparent, #00e8ff, transparent);
    background-size: 100% 220%;
    animation: authPcbFlowVert 2.4s linear infinite;
    opacity: 0.65;
}

.logo-tech-auth .logo-pcb-vert::before { left: 0; }
.logo-tech-auth .logo-pcb-vert::after {
    right: 0;
    animation-delay: 0.7s;
}

.logo-tech-auth .logo-pcb-node {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #00e8ff;
    box-shadow: 0 0 6px #00e8ff;
    animation: authPcbNodeBlink 2s ease-in-out infinite;
    z-index: 5;
}

.logo-tech-auth .logo-pcb-node-tl { top: -2px; left: 5px; }
.logo-tech-auth .logo-pcb-node-tr { top: -2px; right: 5px; animation-delay: 0.35s; }
.logo-tech-auth .logo-pcb-node-bl { bottom: -2px; left: 5px; animation-delay: 0.7s; }
.logo-tech-auth .logo-pcb-node-br { bottom: -2px; right: 5px; animation-delay: 1.05s; }

.auth-logo-mark {
    display: none;
}

.auth-tagline {
    display: inline-block;
    min-height: 1.2em;
    color: var(--primary-dark) !important;
    opacity: 1 !important;
    font-weight: 500;
}

.auth-tagline::after {
    content: '|';
    margin-left: 2px;
    animation: authCursorBlink 0.9s step-end infinite;
    color: var(--primary);
}

.auth-tagline.typed-done::after {
    display: none;
}

/* Formulario */
.auth-form .auth-field {
    position: relative;
}

.auth-form .form-label {
    transition: color 0.25s, transform 0.25s;
}

.auth-form .form-control {
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}

.auth-form .form-control:focus {
    transform: translateY(-1px);
    box-shadow: 0 0 0 0.2rem rgba(30, 208, 213, 0.22), 0 4px 14px rgba(30, 208, 213, 0.12);
}

.auth-form .form-control.auth-input-valid {
    border-color: rgba(30, 208, 213, 0.55);
}

.auth-form .btn-primary-custom {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.25s, background 0.2s;
}

.auth-form .btn-primary-custom::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
    transform: translateX(-120%);
    transition: transform 0.55s ease;
}

.auth-form .btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(7, 173, 173, 0.35);
}

.auth-form .btn-primary-custom:hover::after {
    transform: translateX(120%);
}

.auth-form .btn-primary-custom:active {
    transform: translateY(0);
}

.auth-form .btn-primary-custom.is-loading {
    pointer-events: none;
    opacity: 0.88;
}

.auth-form-links a {
    transition: color 0.2s, letter-spacing 0.2s;
}

.auth-form-links a:hover {
    letter-spacing: 0.02em;
}

.auth-alert {
    animation: authFadeUp 0.4s ease both;
}

@keyframes authBgShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes authOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(12px, -10px) scale(1.06); }
}

@keyframes authCardIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes authFadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes authLogoBorderFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes authLogoRingPulse {
    0%, 100% { opacity: 0.35; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.03); box-shadow: 0 0 16px 2px rgba(30, 208, 213, 0.18); }
}

@keyframes authLogoScan {
    0% { top: -45%; opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

@keyframes authLogoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes authPcbFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 220% 50%; }
}

@keyframes authPcbFlowVert {
    0% { background-position: 50% 0%; }
    100% { background-position: 50% 220%; }
}

@keyframes authPcbNodeBlink {
    0%, 100% { opacity: 0.35; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.15); }
}

@keyframes authCursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page,
    .auth-card,
    .auth-animate-item,
    .logo-tech-auth.logo-tech-wrap,
    .logo-tech-auth .logo-tech-ring,
    .logo-tech-auth .logo-tech-scan::after,
    .logo-tech-auth .auth-logo-img,
    .logo-tech-auth .logo-float,
    .logo-tech-auth .logo-pcb-layer::before,
    .logo-tech-auth .logo-pcb-layer::after,
    .logo-tech-auth .logo-pcb-vert::before,
    .logo-tech-auth .logo-pcb-vert::after,
    .logo-tech-auth .logo-pcb-node,
    .auth-bg-shapes::before,
    .auth-bg-shapes::after {
        animation: none !important;
    }

    .auth-form .form-control:focus,
    .auth-form .btn-primary-custom:hover {
        transform: none;
    }
}
