/* ============================================
   SPLASH — CebaSmart Premium
   Mínimo 5s + espera a que Render despierte
============================================ */

#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 30% 20%, #0d1f3c 0%, #040c1a 45%, #020810 100%);
  transition: opacity 0.85s ease, visibility 0.85s ease;
}

#splash.spl-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ── Grid tecnológico de fondo ── */
.spl-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34,197,94,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,197,94,0.045) 1px, transparent 1px);
  background-size: 58px 58px;
  pointer-events: none;
}

/* ── Manchas de luz / glow ── */
.spl-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.spl-glow-1 {
  width: 720px; height: 720px;
  background: radial-gradient(circle, rgba(34,197,94,0.15) 0%, transparent 65%);
  top: -260px; right: -160px;
  animation: spl-float 9s ease-in-out infinite;
}

.spl-glow-2 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(30,58,138,0.26) 0%, transparent 65%);
  bottom: -200px; left: -130px;
  animation: spl-float 13s ease-in-out infinite reverse;
}

.spl-glow-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  top: 40%; left: 10%;
  animation: spl-float 7s ease-in-out infinite 2s;
}

@keyframes spl-float {
  0%,100% { transform: translate(0,0)        scale(1);    }
  33%     { transform: translate(22px,-28px)  scale(1.06); }
  66%     { transform: translate(-16px,18px)  scale(0.96); }
}

/* ── Panel principal ── */
.spl-panel {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 520px;
  padding: 46px 42px 38px;
  text-align: center;

  background: rgba(255,255,255,0.042);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);

  border-radius: 26px;
  border: 1px solid rgba(34,197,94,0.16);

  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 0 70px rgba(34,197,94,0.09),
    0 35px 90px rgba(0,0,0,0.72),
    inset 0 1px 0 rgba(255,255,255,0.09);

  animation: spl-enter 0.85s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes spl-enter {
  from { opacity:0; transform:translateY(36px) scale(0.94); }
  to   { opacity:1; transform:translateY(0)    scale(1);    }
}

/* ── Badge superior ── */
.spl-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 16px;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.22);
  border-radius: 20px;
  font-size: 12px;
  color: #4ade80;
  letter-spacing: 0.07em;
  margin-bottom: 26px;
}

.spl-badge-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(1.2);
}

/* ── Logo ── */
.spl-logo-wrap {
  margin-bottom: 16px;
}

.spl-logo-img {
  max-width: 300px;
  width: 100%;
  height: auto;
  animation: spl-logo-glow 4s ease-in-out infinite;
}

@keyframes spl-logo-glow {
  0%,100% { filter: brightness(1.1)  drop-shadow(0 0 24px rgba(34,197,94,0.38)); }
  50%     { filter: brightness(1.22) drop-shadow(0 0 42px rgba(34,197,94,0.65)); }
}

.spl-logo-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.spl-logo-fallback-icon { font-size: 58px; line-height: 1; }

.spl-logo-fallback-text {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff 0%, #4ade80 55%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: spl-logo-glow 4s ease-in-out infinite;
}

/* ── Tagline ── */
.spl-tagline {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,0.52);
  max-width: 370px;
  margin: 0 auto 28px;
}

/* ── Barra de progreso ── */
.spl-bar-wrap {
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  height: 5px;
  margin-bottom: 13px;
  overflow: hidden;
}

.spl-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  border-radius: 99px;
  transition: width 0.65s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 14px rgba(34,197,94,0.6);
  animation: spl-bar-pulse 2.2s ease-in-out infinite;
}

@keyframes spl-bar-pulse {
  0%,100% { box-shadow: 0 0 10px rgba(34,197,94,0.5); }
  50%     { box-shadow: 0 0 26px rgba(34,197,94,0.9); }
}

/* ── Texto de estado ── */
.spl-status {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  min-height: 20px;
  margin-bottom: 14px;
  transition: opacity 0.35s;
}

.splash-message-icon {
  width: 22px;
  height: 22px;
  max-width: 22px;
  max-height: 22px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  filter: brightness(1.2);
}

/* ── Aviso servidor (aparece tras 5s si Render no responde) ── */
.spl-notice {
  display: none;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  font-size: 12px;
  line-height: 1.68;
  color: rgba(255,255,255,0.38);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 13px 16px;
  margin-bottom: 22px;
  animation: spl-fade-in 0.55s ease;
}

.spl-notice strong { color: rgba(255,255,255,0.62); }
.spl-notice-icon   { font-size: 16px; flex-shrink: 0; margin-top: 2px; }

@keyframes spl-fade-in {
  from { opacity:0; transform:translateY(6px); }
  to   { opacity:1; transform:translateY(0);   }
}

/* ── Powered by CoreMasterX ── */
.spl-powered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  flex-wrap: wrap;
}

.spl-powered-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 0.2s;
}

.spl-powered-link:hover { color: #4ade80; }

.spl-powered-ico {
  height: 16px;
  width: auto;
  filter: brightness(1.5);
  opacity: 0.8;
}

.spl-powered-url {
  font-size: 10px;
  color: rgba(255,255,255,0.38);
  text-decoration: none;
  transition: color 0.2s;
}

.spl-powered-url:hover { color: #4ade80; }
.spl-powered-sep       { opacity: 0.3; }

/* ── Responsive ── */
@media (max-width: 580px) {
  .spl-panel       { padding: 36px 22px 28px; }
  .spl-logo-img    { max-width: 230px; }
  .spl-logo-fallback-text { font-size: 32px; }
  .spl-badge       { font-size: 11px; }
  .spl-tagline     { font-size: 13px; }
}

@media (max-width: 380px) {
  .spl-logo-fallback-text { font-size: 26px; }
}
