/* Web de la beta de Glee. Tokens de la app (SPEC RF-UX-01): azul de marca con texto siempre en tinta, nunca blanco. */

@font-face {
  font-family: 'Poppins';
  src: url('/fonts/Poppins_500Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('/fonts/Poppins_700Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('/fonts/Poppins_800ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-display: swap;
}

:root {
  --blue: #0e9bfe;
  --blue-light: #63c7ff;
  --blue-text: #0a6cb8;
  --blue-tint: #e6f4ff;
  --ink: #060708;
  --ink-soft: #5d6475;
  --night: #0b0d12;
  --night-raised: #14171f;
  --on-night-soft: #b4bccb;
  --paper: #ffffff;
  --field: #f1f3f7;
  --error: #d93025;
  --gutter: clamp(20px, 5vw, 48px);
  --radius-card: 20px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--blue);
  color: var(--ink);
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.55;
  caret-color: var(--ink);
}

::selection {
  background: var(--ink);
  color: var(--blue);
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Portada ---------- */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 100svh;
  padding: 28px 0 56px;
  background: linear-gradient(160deg, var(--blue) 55%, var(--blue-light) 140%);
}

.brand {
  display: inline-block;
  line-height: 0;
}

.brand img {
  height: 64px;
  width: auto;
}

.hero-grid {
  display: grid;
  gap: 24px;
  margin-top: 20px;
}

.display {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.9rem, 13vw, 6rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.lede {
  margin: 20px 0 0;
  max-width: 34ch;
  font-size: clamp(1.0625rem, 2.6vw, 1.3rem);
  line-height: 1.45;
}

.launch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  padding: 8px 16px 8px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
}

.launch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
}

/* Destellos de bola de discoteca: decoración, quietos si se pide menos movimiento. */
.flecks {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.flecks span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  background: #ffffff;
  border-radius: 2px;
  opacity: 0;
  transform: rotate(45deg) scale(0.4);
  animation: twinkle var(--d, 6s) var(--ease-out) var(--delay, 0s) infinite;
}

.flecks span:nth-child(1) { --x: 8%; --y: 14%; --s: 10px; --d: 6.5s; --delay: 0.2s; }
.flecks span:nth-child(2) { --x: 82%; --y: 9%; --s: 14px; --d: 7s; --delay: 1.4s; }
.flecks span:nth-child(3) { --x: 64%; --y: 30%; --s: 8px; --d: 5.5s; --delay: 2.6s; }
.flecks span:nth-child(4) { --x: 92%; --y: 46%; --s: 12px; --d: 6s; --delay: 0.9s; }
.flecks span:nth-child(5) { --x: 18%; --y: 58%; --s: 7px; --d: 7.5s; --delay: 3.3s; }
.flecks span:nth-child(6) { --x: 48%; --y: 8%; --s: 9px; --d: 6.2s; --delay: 4.1s; }
.flecks span:nth-child(7) { --x: 74%; --y: 72%; --s: 11px; --d: 6.8s; --delay: 2s; }
.flecks span:nth-child(8) { --x: 4%; --y: 86%; --s: 13px; --d: 7.2s; --delay: 5s; }
.flecks span:nth-child(9) { --x: 38%; --y: 92%; --s: 8px; --d: 5.8s; --delay: 1.1s; }
.flecks span:nth-child(10) { --x: 56%; --y: 50%; --s: 6px; --d: 6.4s; --delay: 3.8s; }

@keyframes twinkle {
  0%,
  100% {
    opacity: 0;
    transform: rotate(45deg) scale(0.4);
  }
  18% {
    opacity: 0.85;
    transform: rotate(45deg) scale(1);
  }
  45% {
    opacity: 0;
    transform: rotate(45deg) scale(0.6);
  }
}

/* ---------- Formulario ---------- */

.signup {
  background: var(--paper);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 18px 40px -12px rgba(6, 7, 8, 0.35);
}

.signup h2 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.signup .hint {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.invite {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--blue-tint);
  font-size: 0.95rem;
  line-height: 1.45;
}

.invite strong {
  font-weight: 700;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 0.95rem;
}

.field input {
  width: 100%;
  min-height: 54px;
  padding: 0 20px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
}

.field input:focus-visible {
  outline: none;
  border-color: var(--ink);
  background: var(--paper);
}

.field input[aria-invalid='true'] {
  border-color: var(--error);
}

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  cursor: pointer;
}

.check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--ink);
}

.check a {
  color: var(--blue-text);
  font-weight: 700;
}

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  margin-top: 20px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms var(--ease-out),
    background-color 160ms var(--ease-out);
}

.button:hover {
  background: #23262d;
}

.button:active {
  transform: scale(0.98);
}

.button[aria-busy='true'] {
  opacity: 0.7;
  cursor: progress;
}

.button.secondary {
  background: var(--field);
  color: var(--ink);
}

.button.secondary:hover {
  background: #e3e7ee;
}

.message {
  margin: 14px 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.message.error {
  color: var(--error);
  font-weight: 700;
}

.done h2 {
  margin-top: 4px;
}

.done-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blue);
}

.small-print {
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

/* ---------- Pasos ---------- */

.section {
  padding: clamp(64px, 12vw, 120px) 0;
  background: var(--paper);
}

.section h2 {
  margin: 0;
  max-width: 16ch;
  font-weight: 800;
  font-size: clamp(2.1rem, 8vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.steps {
  display: grid;
  gap: 28px;
  margin: clamp(36px, 7vw, 64px) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--blue);
  font-weight: 800;
  font-size: 1.35rem;
}

.steps h3 {
  margin: 4px 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.steps p {
  margin: 0;
  max-width: 46ch;
  color: var(--ink-soft);
}

/* ---------- De noche ---------- */

.night {
  background: var(--night);
  color: #ffffff;
}

.night h2 {
  color: #ffffff;
}

.features {
  margin: clamp(36px, 7vw, 64px) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid #262a33;
}

.features li {
  padding: 26px 0;
  border-bottom: 1px solid #262a33;
}

.features h3 {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: clamp(1.4rem, 4.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.features p {
  margin: 0;
  max-width: 52ch;
  color: var(--on-night-soft);
}

.honest {
  margin: 36px 0 0;
  max-width: 44ch;
  font-size: clamp(1.15rem, 3.2vw, 1.45rem);
  line-height: 1.4;
  font-weight: 700;
}

.honest em {
  font-style: normal;
  color: var(--blue);
}

.night .button {
  width: auto;
  margin-top: 36px;
  background: var(--blue);
  color: var(--ink);
}

.night .button:hover {
  background: var(--blue-light);
}

.night :focus-visible {
  outline-color: var(--blue);
}

/* ---------- Pie ---------- */

.footer {
  padding: 40px 0 48px;
  background: var(--night);
  border-top: 1px solid #262a33;
  color: var(--on-night-soft);
  font-size: 0.9rem;
}

.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  justify-content: space-between;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.footer a {
  color: #ffffff;
}

.footer :focus-visible {
  outline-color: var(--blue);
}

/* ---------- Páginas secundarias (grupo, baja, legales) ---------- */

.page {
  min-height: 100svh;
  padding: 28px 0 64px;
}

.page .brand img {
  height: 64px;
}

.panel {
  max-width: 560px;
  margin-top: clamp(28px, 6vh, 56px);
}

.panel .display {
  font-size: clamp(2.4rem, 10vw, 4rem);
}

.panel .signup {
  margin-top: 28px;
}

.group-count {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.slots {
  display: flex;
  gap: 8px;
  margin: 14px 0 6px;
  padding: 0;
  list-style: none;
}

.slots li {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px dashed var(--ink-soft);
}

.slots li.filled {
  border: 0;
  background: var(--blue);
  background-image: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.55) 0 4px, transparent 5px);
}

.share-link {
  margin: 16px 0 0;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--field);
  font-weight: 700;
  word-break: break-all;
  user-select: all;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.actions .button {
  margin-top: 0;
}

.legal {
  max-width: 68ch;
  margin-top: 32px;
  padding: clamp(24px, 5vw, 44px);
  border-radius: var(--radius-card);
  background: var(--paper);
}

.legal h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.legal h2 {
  margin: 32px 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
}

.legal p,
.legal li {
  color: var(--ink-soft);
}

.legal ul,
.legal ol {
  padding-left: 1.25em;
}

.legal li + li {
  margin-top: 6px;
}

.legal strong {
  color: var(--ink);
}

.legal a {
  color: var(--blue-text);
  font-weight: 700;
}

.legal mark {
  padding: 0 4px;
  border-radius: 4px;
  background: #fff4cc;
  color: var(--ink);
}

.version {
  margin: 8px 0 0;
  font-size: 0.85rem;
}

.small-print a {
  color: var(--blue-text);
}

.pending {
  display: inline-block;
  margin: 8px 0 0;
  padding: 6px 12px;
  border-radius: 8px;
  background: #fff4cc;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.85rem;
}

.back {
  display: inline-block;
  margin-top: 24px;
  font-weight: 700;
}

/* ---------- Pantallas anchas ---------- */

@media (min-width: 900px) {
  .hero {
    display: flex;
    flex-direction: column;
  }

  .brand img {
    height: 92px;
  }

  .hero-grid {
    flex: 1;
    margin-top: clamp(28px, 7vh, 72px);
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: center;
    gap: 64px;
  }

  .signup {
    padding: 32px;
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }

  .steps li {
    grid-template-columns: 1fr;
  }

  .button {
    width: auto;
  }

  .signup .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .flecks span {
    animation: none;
    opacity: 0.35;
    transform: rotate(45deg) scale(0.8);
  }

  .button {
    transition: none;
  }
}
