/* AquaLog — Fase 0
 * Interfaz para usarse de pie delante del acuario: objetivos táctiles grandes,
 * contraste alto, sin desplazamiento horizontal. Tema oscuro por defecto
 * (sala de acuarios suele estar en penumbra); claro vía prefers-color-scheme.
 */

:root {
  --bg: #0b1220;
  --superficie: #131c2e;
  --superficie-2: #1b2740;
  --borde: #2a3a58;
  --texto: #e8eef7;
  --texto-tenue: #9fb0c7;
  --acento: #22d3ee;
  --acento-fuerte: #0e7490;

  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --pending: #64748b;

  --radio: 14px;
  --tap: 52px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f6fb;
    --superficie: #ffffff;
    --superficie-2: #e9f0f8;
    --borde: #c9d6e6;
    --texto: #0f1b2d;
    --texto-tenue: #4a5b72;
    --acento: #0e7490;
    --acento-fuerte: #0e7490;
  }
}

* { box-sizing: border-box; }

/* El atributo hidden debe ganar a las reglas de display de más abajo
 * (p. ej. .boton { display: block }). */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--texto);
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.app {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.cabecera {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.cabecera h1 {
  margin: 0;
  font-size: 1.9rem;
  letter-spacing: 0.5px;
}

.version {
  color: var(--texto-tenue);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.fase {
  margin: 6px 0 22px;
  color: var(--texto-tenue);
  font-size: 0.95rem;
}

.panel {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 16px;
  margin-bottom: 18px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: var(--texto-tenue);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.estados {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.estado {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.estado .punto {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--pending);
}

.estado[data-nivel="ok"] .punto { background: var(--ok); }
.estado[data-nivel="warn"] .punto { background: var(--warn); }
.estado[data-nivel="err"] .punto { background: var(--err); }
.estado[data-nivel="pending"] .punto {
  background: var(--pending);
  animation: latido 1.2s ease-in-out infinite;
}

@keyframes latido {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .estado[data-nivel="pending"] .punto { animation: none; }
}

.linea {
  display: flex;
  flex-direction: column;
}

.linea strong { font-weight: 600; }

.linea .texto {
  color: var(--texto-tenue);
  font-size: 0.95rem;
}

.boton {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 14px 18px;
  margin: 10px 0 0;
  border: 0;
  border-radius: var(--radio);
  background: var(--acento-fuerte);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
}

.boton:active { transform: translateY(1px); }
.boton:disabled { opacity: 0.55; cursor: default; }

.boton--secundario {
  background: var(--superficie-2);
  color: var(--texto);
  border: 1px solid var(--borde);
}

.ayuda {
  margin: 12px 0 0;
  padding: 12px 14px;
  background: var(--superficie-2);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  font-size: 0.95rem;
  color: var(--texto-tenue);
}

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 14px;
  padding: 14px;
  background: var(--superficie-2);
  border: 1px solid var(--acento);
  border-radius: var(--radio);
}

.banner .boton { width: auto; margin: 0; }

.pie {
  margin-top: 8px;
  color: var(--texto-tenue);
  font-size: 0.85rem;
  text-align: center;
}
