/* ---- Loading overlay ---- */
#ie-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #060d1f 0%, #0a1a3a 55%, #123a6b 100%);
    transition: opacity .65s ease, visibility .65s ease;
}
#ie-loader.ie-fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Partículas flotantes de fondo */
.ie-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.ie-particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: ie-float var(--dur, 4s) var(--delay, 0s) ease-in-out infinite;
}
@keyframes ie-float {
    0%   { opacity: 0;    transform: translateY(0)    scale(.6); }
    20%  { opacity: .18; }
    80%  { opacity: .12; }
    100% { opacity: 0;    transform: translateY(-110px) scale(1.1); }
}

/* Ondas concéntricas detrás del logo */
.ie-rings {
    position: absolute;
    width: 170px;
    height: 170px;
    border-radius: 50%;
}
.ie-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.28);
    animation: ie-ring-pulse 2.6s ease-out infinite;
    opacity: 0;
}
.ie-ring:nth-child(1) { animation-delay: 0s; }
.ie-ring:nth-child(2) { animation-delay: .65s; }
.ie-ring:nth-child(3) { animation-delay: 1.3s; }
@keyframes ie-ring-pulse {
    0%   { transform: scale(1);   opacity: .55; }
    100% { transform: scale(2.6); opacity: 0; }
}

/* Contenedor del logo */
.ie-logo-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 36px;
    animation: ie-logo-in 1s cubic-bezier(.22,1,.36,1) forwards;
    opacity: 0;
}
@keyframes ie-logo-in {
    0%   { opacity: 0; transform: scale(.6) translateY(20px); }
    60%  { opacity: 1; transform: scale(1.06) translateY(-4px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Badge circular igual al del header */
.ie-logo-badge {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #2f6fed;
    box-shadow:
        0 0 0 6px rgba(47,111,237,.12),
        0 0 0 12px rgba(47,111,237,.06),
        0 16px 48px rgba(10,26,58,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    animation: ie-badge-pulse 2.8s ease-in-out 1.2s infinite;
}
@keyframes ie-badge-pulse {
    0%, 100% { box-shadow: 0 0 0 6px rgba(47,111,237,.12), 0 0 0 12px rgba(47,111,237,.06), 0 16px 48px rgba(10,26,58,.18); }
    50%       { box-shadow: 0 0 0 8px rgba(47,111,237,.20), 0 0 0 18px rgba(47,111,237,.08), 0 20px 56px rgba(10,26,58,.24); }
}
.ie-logo-badge img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    display: block;
}

/* Destellos dorados en las esquinas del badge */
.ie-glow {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f0a500;
    box-shadow: 0 0 10px 4px rgba(240,165,0,.5);
    animation: ie-glow-orbit 3s linear infinite;
}
@keyframes ie-glow-orbit {
    0%   { transform: rotate(0deg)   translateX(70px); opacity: 0; }
    15%  { opacity: 1; }
    85%  { opacity: 1; }
    100% { transform: rotate(360deg) translateX(70px); opacity: 0; }
}
.ie-glow:nth-child(2) { animation-delay: -1s; background: #2f6fed; box-shadow: 0 0 10px 4px rgba(47,111,237,.5); }
.ie-glow:nth-child(3) { animation-delay: -2s; background: #f0a500; box-shadow: 0 0 8px 3px rgba(240,165,0,.4); width:5px; height:5px; }

/* Nombre del colegio */
.ie-name {
    font-family: "Josefin Sans", sans-serif;
    font-size: clamp(1rem, 2.2vw, 1.25rem);
    font-weight: 800;
    color: #ffffff;
    text-align: center;
    letter-spacing: .01em;
    line-height: 1.3;
    margin-bottom: 6px;
    opacity: 0;
    animation: ie-text-in .8s ease .7s forwards;
}
.ie-sub {
    font-family: "Open Sans", sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    color: #8fb8ff;
    text-align: center;
    letter-spacing: .18em;
    text-transform: uppercase;
    margin-bottom: 36px;
    opacity: 0;
    animation: ie-text-in .8s ease .95s forwards;
}
@keyframes ie-text-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Barra de progreso */
.ie-bar-wrap {
    width: min(340px, 80vw);
    height: 4px;
    background: rgba(255,255,255,.16);
    border-radius: 30px;
    overflow: hidden;
    opacity: 0;
    animation: ie-text-in .6s ease 1.1s forwards;
    margin-bottom: 14px;
}
.ie-bar {
    height: 100%;
    width: 0;
    border-radius: 30px;
    background: linear-gradient(90deg, #2f6fed, #f0a500, #2f6fed);
    background-size: 200% 100%;
    animation: ie-bar-fill 2.2s cubic-bezier(.4,0,.2,1) 1.2s forwards,
               ie-bar-shimmer 1.8s linear 1.2s infinite;
}
@keyframes ie-bar-fill {
    from { width: 0%; }
    to   { width: 100%; }
}
@keyframes ie-bar-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Texto "cargando..." */
.ie-loading-text {
    font-family: "Open Sans", sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #aebfe0;
    letter-spacing: .15em;
    text-transform: uppercase;
    opacity: 0;
    animation: ie-text-in .6s ease 1.3s forwards;
}
.ie-dots span {
    display: inline-block;
    width: 4px; height: 4px;
    background: #aebfe0;
    border-radius: 50%;
    margin: 0 2px;
    animation: ie-dot-bounce .9s ease infinite;
}
.ie-dots span:nth-child(2) { animation-delay: .15s; }
.ie-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes ie-dot-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity:.4; }
    40%            { transform: translateY(-5px); opacity:1; }
}
