/* ════════════════════════════════════════════
   PULSE OVERTURE — Panel Cliente
   Navy profundo. Glass. Glow que respira.
   ════════════════════════════════════════════ */

:root {
  --navy: #0A0E2A;
  --navy-soft: #11163A;
  --blue: #3B45E0;
  --orange: #F47920;
  --beige: #F4F1EC;
  --ink: #111118;
  --text: #F4F1EC;
  --text-dim: rgba(244, 241, 236, 0.55);
  --glass: rgba(255, 255, 255, 0.045);
  --glass-border: rgba(255, 255, 255, 0.09);
  --display: 'Syne', sans-serif;
  --body: 'DM Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--navy);
  color: var(--text);
  font-family: var(--body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ══════════ SPLASH DE ENCENDIDO ══════════ */

#splash {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.45s ease;
}

#splash.off { opacity: 0; pointer-events: none; }

.splash-logo { width: 120px; height: auto; }

.sbar {
  fill: var(--blue);
  opacity: 0;
  animation: ignite 0.35s ease forwards;
}
.sbar-1 { animation-delay: 0.15s; }
.sbar-2 { animation-delay: 0.45s; }
.sbar-3 { animation-delay: 0.75s; }
.sbar-4 {
  fill: var(--orange);
  animation-delay: 1.05s;
  filter: drop-shadow(0 0 14px rgba(244, 121, 32, 0.8));
}

@keyframes ignite {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.splash-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.35em;
  color: var(--beige);
  opacity: 0;
  animation: fadeName 0.6s ease 1.5s forwards;
}

@keyframes fadeName {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════ HEADER ══════════ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 40px);
  background: rgba(10, 14, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}

.brand { display: flex; align-items: center; gap: 12px; }

.logo-mini {
  width: 34px;
  height: auto;
  animation: heartbeat 3s ease-in-out infinite;
  transform-origin: center bottom;
}
.logo-mini .bar { fill: var(--blue); }
.logo-mini .bar-accent { fill: var(--orange); }

@keyframes heartbeat {
  0%, 88%, 100% { transform: scale(1); }
  91% { transform: scale(1.08); }
  94% { transform: scale(1); }
  97% { transform: scale(1.05); }
}

.brand-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
}

/* Estado */
.status-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3DDC84;
  animation: dotPulse 2.4s ease-in-out infinite;
}
.status-dot.warn {
  background: #FFC233;
  animation-name: dotPulseWarn;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.55); }
  50%      { box-shadow: 0 0 0 7px rgba(61, 220, 132, 0); }
}
@keyframes dotPulseWarn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 194, 51, 0.55); }
  50%      { box-shadow: 0 0 0 7px rgba(255, 194, 51, 0); }
}

.status-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* ══════════ CONTENIDO ══════════ */

.content {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 40px) 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.greeting h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  line-height: 1.1;
}

.greeting-sub {
  color: var(--text-dim);
  margin-top: 6px;
  font-size: 0.95rem;
}

/* Cards — glassmorphism */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: clamp(20px, 4vw, 30px);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateY(26px);
  animation: rise 0.6s cubic-bezier(0.22, 0.8, 0.3, 1) forwards;
  animation-delay: calc(var(--delay, 0) * 0.12s + 0.1s);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.18), transparent 40%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.metric-label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.metric-big {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.2rem, 10vw, 5.2rem);
  line-height: 1;
}

.metric-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1;
}

.metric-unit {
  font-size: 0.45em;
  color: var(--text-dim);
  font-weight: 700;
}

.metric-foot {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Glow que respira */
.glow-orange {
  color: var(--orange);
  animation: breatheOrange 4s ease-in-out infinite;
}
@keyframes breatheOrange {
  0%, 100% { text-shadow: 0 0 12px rgba(244, 121, 32, 0.35); }
  50%      { text-shadow: 0 0 28px rgba(244, 121, 32, 0.75); }
}

.glow-blue {
  color: #8A92FF;
  animation: breatheBlue 4s ease-in-out infinite;
}
@keyframes breatheBlue {
  0%, 100% { text-shadow: 0 0 12px rgba(59, 69, 224, 0.35); }
  50%      { text-shadow: 0 0 26px rgba(59, 69, 224, 0.7); }
}

/* Historial */
.history-list { list-style: none; }

.history-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.92rem;
}
.history-list li:last-child { border-bottom: none; }

.history-week { color: var(--text); font-weight: 500; }
.history-stats { color: var(--text-dim); font-size: 0.82rem; text-align: right; }
.history-empty { color: var(--text-dim); font-size: 0.88rem; }

/* CTA */
.cta-wrap {
  opacity: 0;
  transform: translateY(26px);
  animation: rise 0.6s cubic-bezier(0.22, 0.8, 0.3, 1) forwards;
  animation-delay: calc(var(--delay, 0) * 0.12s + 0.1s);
  text-align: center;
  margin-top: 8px;
}

.cta {
  display: inline-block;
  font-family: var(--body);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  background: var(--orange);
  padding: 16px 34px;
  border-radius: 99px;
  text-decoration: none;
  box-shadow: 0 0 24px rgba(244, 121, 32, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 38px rgba(244, 121, 32, 0.55);
}
.cta:focus-visible {
  outline: 2px solid var(--beige);
  outline-offset: 3px;
}

/* Push */
.push-wrap {
  text-align: center;
  opacity: 0;
  animation: rise 0.6s ease forwards;
  animation-delay: 1s;
}
.push-btn {
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  padding: 12px 24px;
  border-radius: 99px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.push-btn:hover { border-color: var(--blue); }
.push-hint { margin-top: 8px; font-size: 0.78rem; color: var(--text-dim); }

.foot {
  text-align: center;
  padding: 30px 16px 44px;
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* Error de acceso */
.access-error {
  min-height: 100vh;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
}
.access-error.hidden { display: none !important; }
.access-sub {
  font-family: var(--body);
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ══════════ RESPONSIVE ══════════ */

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .brand-name { display: none; }
}

@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

/* Accesibilidad: movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card, .cta-wrap, .push-wrap { opacity: 1; transform: none; }
}
