/* Fondo dinamico institucional - I.E.P HENRY FORD */
html {
    min-height: 100%;
}

body {
    position: relative;
    overflow-x: hidden;
    background-size: 260% 260% !important;
    animation: fondoHenryFord 10s ease-in-out infinite !important;
}

body.modo-oscuro {
    background:
        linear-gradient(120deg, rgba(14, 165, 233, 0.34), transparent 28%),
        linear-gradient(300deg, rgba(34, 197, 94, 0.28), transparent 30%),
        radial-gradient(circle at 18% 20%, rgba(56, 189, 248, 0.48), transparent 24%),
        radial-gradient(circle at 86% 24%, rgba(34, 197, 94, 0.38), transparent 24%),
        radial-gradient(circle at 48% 86%, rgba(245, 158, 11, 0.34), transparent 28%),
        linear-gradient(135deg, #07111f 0%, #111827 44%, #172554 100%) !important;
}

body.modo-claro {
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.62), transparent 26%),
        linear-gradient(300deg, rgba(251, 191, 36, 0.46), transparent 30%),
        radial-gradient(circle at 12% 14%, rgba(255, 255, 255, 0.70), transparent 24%),
        radial-gradient(circle at 88% 20%, rgba(253, 224, 71, 0.65), transparent 26%),
        radial-gradient(circle at 56% 92%, rgba(45, 212, 191, 0.56), transparent 30%),
        linear-gradient(135deg, #22d3ee 0%, #38bdf8 32%, #a7f3d0 68%, #fbbf24 100%) !important;
}

body::before,
body::after {
    content: "";
    position: fixed;
    pointer-events: none;
    border-radius: 999px;
    filter: blur(8px);
    opacity: 0.52;
    z-index: 0;
    will-change: transform;
}

body::before {
    width: 420px;
    height: 420px;
    left: -140px;
    top: 12%;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.34), transparent 24%),
        linear-gradient(135deg, #38bdf8, #22c55e);
    animation: luzGrandeHenry 7s ease-in-out infinite alternate;
}

body::after {
    width: 480px;
    height: 480px;
    right: -165px;
    bottom: 4%;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 22%),
        linear-gradient(135deg, #f59e0b, #ef4444, #8b5cf6);
    animation: luzGrandeHenryDos 8s ease-in-out infinite alternate;
}

body > * {
    position: relative;
    z-index: 1;
}

.contenedor::before,
.pagina::before {
    content: "";
    position: fixed;
    inset: -40%;
    pointer-events: none;
    opacity: 0.16;
    z-index: 0;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.95) 1px, transparent 1px),
        linear-gradient(120deg, transparent 42%, rgba(255,255,255,0.22) 50%, transparent 58%);
    background-size: 44px 44px, 260px 260px;
    animation: particulasHenry 14s linear infinite;
}

.boton-acceso,
.btn-tema,
.btn-volver,
.btn-login {
    will-change: transform;
}

@keyframes fondoHenryFord {
    0% { background-position: 0% 50%; }
    25% { background-position: 55% 18%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 45% 86%; }
    100% { background-position: 0% 50%; }
}

@keyframes luzGrandeHenry {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(70px, 34px, 0) scale(1.16); }
    100% { transform: translate3d(145px, -24px, 0) scale(1.05); }
}

@keyframes luzGrandeHenryDos {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-88px, -42px, 0) scale(1.14); }
    100% { transform: translate3d(-154px, 18px, 0) scale(1.06); }
}

@keyframes particulasHenry {
    from { transform: translate3d(0, 0, 0) rotate(0deg); }
    to { transform: translate3d(80px, -80px, 0) rotate(8deg); }
}

@media (max-width: 700px) {
    body::before {
        width: 300px;
        height: 300px;
    }

    body::after {
        width: 340px;
        height: 340px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body,
    body::before,
    body::after,
    .contenedor::before,
    .pagina::before {
        animation: none !important;
    }
}
