/**
 * NexPH - Splash Screen Stylesheet
 * Arquitectura limpia: Separación de estilos visuales fuera del HTML principal
 */

:root {
  --nexph-splash-bg: #07080A;
  --nexph-splash-text: #F8FAFC;
  --nexph-splash-gold: #E5A93C;
  --nexph-splash-gold-light: #F5C042;
  --nexph-splash-gold-dark: #B87D18;
  --nexph-splash-muted: #A1A1AA;
}

html.light {
  --nexph-splash-bg: #F7F6F2;
  --nexph-splash-text: #1C1C1C;
  --nexph-splash-muted: #737373;
}

/* Contenedor principal de pantalla de arranque instantánea (blindado contra resets externos) */
#nexph-app-splash,
#nexph-app-splash *,
#nexph-app-splash *::before,
#nexph-app-splash *::after {
  box-sizing: border-box !important;
}

#nexph-app-splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--nexph-splash-bg);
  background-image:
    radial-gradient(circle at 50% 35%, rgba(229, 169, 60, 0.12) 0%, transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(184, 125, 24, 0.06) 0%, transparent 45%);
  color: var(--nexph-splash-text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  text-align: center;
  padding: 24px;
  user-select: none;
  -webkit-user-select: none;
}

html.light #nexph-app-splash {
  background-image: none;
}

/* Contenedor del Logo con marco dorado permanente y proporción exacta 1720:1516 (128px x 113px) */
.nexph-splash-logo-wrapper {
  position: relative;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nexph-splash-logo-glow {
  width: 128px !important;
  height: 113px !important;
  min-width: 128px !important;
  min-height: 113px !important;
  aspect-ratio: 1720 / 1516;
  border-radius: 14px !important;
  border: 2px solid #E5A93C !important;
  background-color: #07080A !important;
  box-shadow:
    0 0 28px rgba(229, 169, 60, 0.42),
    0 0 6px rgba(245, 192, 66, 0.35),
    inset 0 0 0 1px rgba(245, 192, 66, 0.22) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden !important;
  padding: 0 !important;
  transform: none !important;
  transition: none !important;
}

.nexph-splash-logo-img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 12px !important;
  object-fit: contain !important;
  background-color: #07080A !important;
  display: block !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  transition: none !important;
}

/* Tipografía de marca con serifas elegantes en línea con el logo */
.nexph-splash-brand-title {
  font-family: 'Cinzel', 'Plus Jakarta Sans', Georgia, serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #FFFFFF;
  margin-bottom: 4px;
}

html.light .nexph-splash-brand-title {
  color: #1C1C1C;
}

.nexph-splash-silver-span {
  color: #F8FAFC;
}

html.light .nexph-splash-silver-span {
  color: #1C1C1C;
}

.nexph-splash-gold-span {
  color: #F5C042;
}

html.light .nexph-splash-gold-span {
  color: #B87D18;
}

.nexph-splash-brand-subtitle {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.8px;
  color: var(--nexph-splash-gold);
  margin-bottom: 26px;
  opacity: 0.95;
}

/* Sección de progreso y estado */
.nexph-splash-loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 260px;
}

.nexph-splash-progress-track {
  width: 100%;
  max-width: 180px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

html.light .nexph-splash-progress-track {
  background: rgba(0, 0, 0, 0.08);
}

.nexph-splash-progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 45%;
  background: linear-gradient(90deg, var(--nexph-splash-gold), var(--nexph-splash-gold-light));
  border-radius: 9999px;
  animation: nexph-splash-load 1.4s ease-in-out infinite;
}

#nexph-splash-status {
  font-size: 12px;
  font-weight: 500;
  color: var(--nexph-splash-muted);
  letter-spacing: 0.3px;
  transition: color 0.3s ease;
}

/* Panel de recuperación rápida para conexiones inestables en móviles */
#nexph-splash-actions {
  display: none;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
}

.nexph-splash-btn-primary {
  width: 100%;
  padding: 10px 16px;
  background-color: var(--nexph-splash-gold);
  color: #0A0A0C;
  font-size: 12px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.nexph-splash-btn-primary:active {
  transform: scale(0.98);
}

.nexph-splash-btn-secondary {
  width: 100%;
  padding: 8px 14px;
  background-color: #18181E;
  color: #D4D4D8;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #27272A;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nexph-splash-btn-secondary:hover {
  background-color: #22222A;
  border-color: #3F3F46;
}

/* Animación de carga fluida */
@keyframes nexph-splash-load {
  0% {
    left: -45%;
    width: 35%;
  }
  50% {
    left: 35%;
    width: 50%;
  }
  100% {
    left: 100%;
    width: 35%;
  }
}
