/* ============================================================================
   Forge Protein — capa propia sobre el sistema de diseño del sitio.

   Hereda los tokens de /styles.css (superficies, tipografía, azul/cian de
   marca) y añade solo lo que este módulo necesita: la retícula de ocho
   depósitos, las tarjetas de sabor y la pantalla de votación.

   El carácter es un punto más industrial que el resto del sitio —tipografía
   condensada en mayúsculas, numeración tipo edición limitada— pero sobre el
   mismo fondo y el mismo acento, para que se lea como Forge y no como otra
   marca.
============================================================================ */

/* ── Tokens propios ─────────────────────────────────────────────────────────
   Mismos valores que `/styles.css`, declarados aquí a propósito.

   Antes estas páginas heredaban los tokens del CSS del sitio de marketing, y
   eso creaba un modo de fallo asqueroso: si esa hoja no llegaba —caché sucia,
   bloqueador, red rara—, todo lo que fuera `var(--…)` quedaba SIN RESOLVER y la
   declaración entera se volvía inválida. Resultado en un móvil real: fuente
   serif del navegador (porque `font-family: var(--font)` no computa), tarjetas
   sin relleno y un botón con texto oscuro sobre fondo oscuro, ilegible. La
   página no fallaba del todo, que es lo peor que puede pasar: fallaba a medias
   y parecía un diseño malo.

   Ahora es autosuficiente. De paso se ahorra descargar 42 KB de CSS de la web
   de marketing que estas páginas no usaban. ── */
:root {
  color-scheme: dark;

  --bg: #06090f;
  --surface-1: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.07);

  --text-100: #eef4fb;
  --text-200: #b8c6d8;
  --text-300: #8193a8;
  --text-400: #5f7088;

  --blue: #2bb6ff;
  --cyan: #22d3ee;
  --ice: #8fe3ff;
  --brand-grad: linear-gradient(135deg, #2bb6ff 0%, #22d3ee 100%);
  --brand-soft: linear-gradient(135deg, rgba(43, 182, 255, 0.16), rgba(34, 211, 238, 0.1));

  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);

  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
  --r-pill: 999px;

  /* Inter llega por <link> de Google Fonts. La pila termina en `sans-serif`
     para que, si esa petición falla o está bloqueada, se caiga a la sans del
     sistema (Roboto en Android) y NUNCA a la serif por defecto. */
  --font: "Inter", "Segoe UI", "SF Pro Text", system-ui, -apple-system,
    "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-100);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  margin: 0;
}

.protein-page {
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 80% -10%, rgba(43, 182, 255, 0.18), transparent 60%),
    radial-gradient(circle at 18% 16%, #11203a, #06090f 58%);
  color: var(--text-100);
  font-family: var(--font);
}

.protein-shell {
  width: min(760px, 92vw);
  margin: 0 auto;
  padding: 28px 0 72px;
}

.protein-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}

.protein-topbar a {
  color: var(--text-200);
  text-decoration: none;
  font-size: 14px;
}

.protein-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ice);
  margin: 0 0 10px;
}

.protein-title {
  font-size: clamp(34px, 9vw, 56px);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

/* Titular de FRASE, no de marca.
   `.protein-title` es el display grande, y está pensado para "FORGE PROTEIN":
   dos palabras. Una frase entera a 56px ocupa tres líneas y media pantalla en
   un móvil, y empuja la única acción por debajo del pliegue. Los estados
   vacíos y de error usan esta variante. */
.protein-title.sentence {
  font-size: clamp(23px, 6vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Un estado vacío o de error ES la página entera: se centra en vertical en
   lugar de quedarse colgado arriba con el 60% en blanco debajo. */
.protein-state {
  min-height: 64vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.protein-sub {
  font-size: clamp(17px, 4.4vw, 22px);
  font-weight: 600;
  color: var(--ice);
  margin: 0 0 14px;
}

.protein-body {
  color: var(--text-200);
  line-height: 1.55;
  margin: 0 0 20px;
}

.protein-card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 14px;
}

.protein-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-300);
  margin: 32px 0 12px;
}

.protein-grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 620px) {
  .protein-grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Sabor ──────────────────────────────────────────────────────────────── */

.flavor-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
}

.flavor-card img {
  width: 56px;
  height: 56px;
  border-radius: var(--r-sm);
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--surface-2);
}

.flavor-name {
  font-weight: 700;
  font-size: 16px;
  margin: 0;
}

.flavor-brand {
  color: var(--text-300);
  font-size: 13px;
  margin: 2px 0 0;
}

.flavor-macros {
  color: var(--text-200);
  font-size: 13px;
  margin: 6px 0 0;
}

.flavor-empty {
  color: var(--text-400);
  font-style: italic;
}

/* ── Insignias ──────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge.community {
  background: rgba(43, 182, 255, 0.16);
  color: var(--ice);
}

.badge.drop {
  background: linear-gradient(135deg, rgba(255, 138, 92, 0.22), rgba(245, 181, 36, 0.2));
  color: #ffd7a8;
}

.badge.ok {
  background: rgba(52, 211, 153, 0.16);
  color: #6ee7b7;
}

.badge.warn {
  background: rgba(245, 181, 36, 0.16);
  color: #fbcf5f;
}

.badge.bad {
  background: rgba(248, 113, 113, 0.16);
  color: #fca5a5;
}

.badge.muted {
  background: var(--surface-2);
  color: var(--text-300);
}

/* ── Depósitos de una máquina ───────────────────────────────────────────── */

.slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.slot-row:last-child {
  border-bottom: 0;
}

.slot-index {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--text-400);
}

/* ── Botones ────────────────────────────────────────────────────────────── */

.protein-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  width: 100%;
  padding: 0 22px;
  border: 0;
  border-radius: var(--r-md);
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  background: var(--brand-grad);
  color: #04121d;
  box-shadow: 0 14px 30px rgba(34, 170, 240, 0.28);
  text-decoration: none;
}

/* Deshabilitado = "todavía no", no "roto". Antes era el degradado al 45% de
   opacidad, que sobre fondo oscuro deja el texto casi ilegible; ahora es una
   superficie apagada de verdad, que se lee como un botón esperando. */
.protein-cta[disabled] {
  background: var(--surface-2);
  color: var(--text-400);
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
}

/* Secundario, no invisible.
   Con `--line-2` (blanco al 14%) el borde daba 1,48:1 de contraste contra el
   fondo — WCAG pide 3:1 para el contorno de un control—, y a 52px de alto el
   botón se leía como texto en negrita, no como algo pulsable. Este tinte de
   marca al 45% mide 3,5:1 y sigue quedando por debajo del primario, que lleva
   degradado sólido. */
.protein-cta.ghost {
  background: transparent;
  border: 1px solid rgba(143, 227, 255, 0.45);
  color: var(--text-100);
  box-shadow: none;
}

/* ── Votación ───────────────────────────────────────────────────────────── */

/* Las papeletas son el control más importante del sitio: si no se leen como
   pulsables, no hay votación. */
.vote-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--surface-1);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--r-lg);
  padding: 15px 16px;
  margin-bottom: 10px;
  color: var(--text-100);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.vote-option:hover {
  border-color: rgba(255, 255, 255, 0.34);
}

.vote-option:active {
  transform: scale(0.995);
}

/* Columna de texto. Sin esto la marca salía PEGADA al nombre del sabor
   ("Rocky RoadOptimum Nutrition"): eran dos <span> en línea, y a un elemento
   en línea el margen vertical no le hace nada. */
.vote-option-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
  min-width: 0;
}

.vote-option-name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
}

.vote-option-brand {
  font-size: 13px;
  font-weight: 500;
  color: var(--ice);
  opacity: 0.85;
}

.vote-option-macros {
  color: var(--text-400);
  font-size: 12px;
}

/* Indicador de selección. El estado NO se transmite solo con color: además del
   borde y el fondo, aparece una marca de verificación dibujada. */
.vote-option-mark {
  position: relative;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.28);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.vote-option[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--brand-soft);
}

.vote-option[aria-pressed="true"] .vote-option-mark {
  border-color: var(--blue);
  background: var(--blue);
}

.vote-option[aria-pressed="true"] .vote-option-mark::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #04121d;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.result-row {
  margin-bottom: 14px;
}

.result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
  margin-bottom: 6px;
}

.result-brand {
  color: var(--text-400);
  font-size: 13px;
}

/* Tu voto, señalado. Al volver a la página lo primero que quieres saber es qué
   votaste. Lleva una etiqueta de texto además del color, porque el color solo
   no comunica nada a quien no lo distingue. */
.result-row.mine .result-head {
  color: var(--ice);
  font-weight: 600;
}

.result-mine-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: rgba(43, 182, 255, 0.18);
  color: var(--ice);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.result-bar {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  overflow: hidden;
}

.result-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--brand-grad);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.vote-registered {
  font-size: clamp(24px, 7vw, 34px);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

/* ── Drop ───────────────────────────────────────────────────────────────── */

.drop-card {
  background:
    linear-gradient(160deg, rgba(255, 138, 92, 0.16), rgba(43, 182, 255, 0.08)),
    var(--surface-1);
  border: 1px solid rgba(255, 138, 92, 0.28);
  border-radius: var(--r-xl);
  padding: 22px;
}

.drop-number {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #ffd7a8;
  text-transform: uppercase;
}

.drop-name {
  font-size: clamp(24px, 6.5vw, 32px);
  font-weight: 800;
  margin: 8px 0 4px;
}

/* ── Estado / carga ─────────────────────────────────────────────────────── */

.protein-note {
  color: var(--text-300);
  font-size: 14px;
  line-height: 1.5;
}

.protein-error {
  color: #fca5a5;
  font-size: 14px;
  margin-top: 12px;
}

.spinner {
  width: 26px;
  height: 26px;
  margin: 40px auto;
  border-radius: 50%;
  border: 3px solid rgba(138, 167, 214, 0.25);
  border-top-color: var(--blue);
  animation: protein-spin 0.9s linear infinite;
}

@keyframes protein-spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}

.stack-gap {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
