/*
 * Flowcus — landing de la lista de espera fundador.
 * Vanilla CSS, mobile-first, tokens EXACTOS de landing/CONTRATO.md (no tocar
 * los valores: si algo se ve mal, se ajusta layout, no la paleta).
 */

:root {
  --bg: #0d1117;
  --card: #161b22;
  --card2: #1c2330;
  --border: #2d3646;
  --txt: #e6edf3;
  --dim: #9aa7b8;
  --gold: #ffc857;
  --diamond: #6ee7ff;
  --green: #4ade80;
  --accent: #58a6ff;

  /* Derivados del botón dorado, mismo criterio visual que la app (globals.css) */
  --btn-primary-shadow: #a5761b;
  --btn-primary-ink: #24190a;

  --font-display: 'Press Start 2P', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', monospace;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --radius: 14px;
  --radius-sm: 10px;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(88, 166, 255, 0.08), transparent 45%),
    radial-gradient(circle at 85% 8%, rgba(255, 200, 87, 0.06), transparent 40%);
  background-attachment: fixed;
  color: var(--txt);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
}

/* ---------- accesibilidad ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card2);
  color: var(--txt);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
  border: 1px solid var(--border);
}

.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--diamond);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- layout general ---------- */

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

.section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.section__titulo {
  font-size: 1.25rem;
  margin: 0 0 20px;
  text-align: center;
}

/* ---------- hero ---------- */

.hero {
  text-align: center;
  padding: 56px 16px 44px;
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

.hero__coin {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 10px;
  animation: coin-float 3.2s ease-in-out infinite;
}

.fx-logo {
  font-family: var(--font-display);
  font-size: clamp(20px, 6vw, 30px);
  letter-spacing: 0.03em;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(255, 200, 87, 0.45);
  margin-bottom: 18px;
}

.hero__badge {
  display: inline-block;
  background: var(--card2);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 6px 14px;
  border-radius: 999px;
  margin: 0 0 18px;
}

.hero__titular {
  font-size: clamp(1.5rem, 6vw, 2.1rem);
  line-height: 1.25;
  margin: 0 0 12px;
}

.hero__subtitulo {
  color: var(--dim);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

@keyframes coin-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---------- cómo funciona ---------- */

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

.step {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px 18px;
  text-align: center;
}

.step__num {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--bg);
  background: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
}

.step__emoji {
  font-size: 28px;
  display: block;
  margin: 10px 0 10px;
}

.step__titulo {
  font-size: 1rem;
  margin: 0 0 6px;
}

.step__desc {
  color: var(--dim);
  font-size: 0.92rem;
  margin: 0;
}

/* ---------- oferta fundador ---------- */

.founder-card {
  background: var(--card);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: 0 0 0 1px rgba(255, 200, 87, 0.12), 0 10px 40px rgba(255, 200, 87, 0.08);
  text-align: center;
}

.founder-card__titulo {
  font-size: 1.3rem;
  margin: 0 0 12px;
}

.founder-card__texto {
  color: var(--txt);
  margin: 0 0 16px;
}

.founder-card__texto:last-child {
  margin-bottom: 0;
}

.founder-card__lista {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.founder-card__lista li {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.92rem;
}

.founder-card__lista li::before {
  content: '🪙 ';
}

/* ---------- form ---------- */

.form-noscript {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--dim);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--txt);
}

.field input,
.field textarea {
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--txt);
  padding: 0 14px;
  font-size: 16px;
  font-family: var(--font-body);
}

.field textarea {
  min-height: 88px;
  padding: 12px 14px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--dim);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.field input[aria-invalid='true'],
.field textarea[aria-invalid='true'] {
  border-color: #f87171;
}

.field-error {
  color: #f87171;
  font-size: 0.85rem;
  margin: 0;
}

.field__meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.field__contador {
  color: var(--dim);
  font-size: 0.78rem;
  margin: 0;
}

/* Honeypot: invisible para personas, presente en el DOM para bots */
.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.btn-primary {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  line-height: 1.4;
  min-height: 52px;
  padding: 0 20px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--gold), #e0a92e);
  color: var(--btn-primary-ink);
  box-shadow: 0 4px 0 var(--btn-primary-shadow);
  cursor: pointer;
  clip-path: polygon(
    0 6px, 6px 6px, 6px 0,
    calc(100% - 6px) 0, calc(100% - 6px) 6px, 100% 6px,
    100% calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) 100%,
    6px 100%, 6px calc(100% - 6px), 0 calc(100% - 6px)
  );
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-primary:active {
  box-shadow: 0 2px 0 var(--btn-primary-shadow);
  transform: translateY(2px) scale(0.99);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  appearance: none;
  cursor: pointer;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--txt);
  font-weight: 700;
  font-size: 0.92rem;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: var(--diamond);
}

.btn-secondary:active {
  transform: scale(0.97);
}

.form-error {
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  margin: 0;
}

.form-error-fallback {
  display: none;
}

.form-legal {
  color: var(--dim);
  font-size: 0.8rem;
  text-align: center;
  margin: 0;
}

/* ---------- pantalla de gracias ---------- */

.thanks {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 32px 22px;
  margin-top: 18px;
}

.thanks__coin {
  font-size: 40px;
  margin-bottom: 10px;
}

.thanks__titulo {
  font-size: 1.3rem;
  line-height: 1.5;
  margin: 0 0 14px;
}

/* El número de posición, inyectado por app.js dentro de .thanks__titulo. */
.thanks__titulo .fx-num {
  color: var(--gold);
  font-size: 0.85em;
  text-shadow: 0 0 14px rgba(255, 200, 87, 0.45);
}

.thanks__mensaje {
  color: var(--txt);
  max-width: 440px;
  margin: 0 auto 22px;
}

.thanks__feedback {
  color: var(--green);
  font-size: 0.85rem;
  margin: 10px 0 0;
}

/* ---------- faq ---------- */

.faq {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq__item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 16px;
}

.faq__item summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 700;
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.faq__item summary::-webkit-details-marker {
  display: none;
}

.faq__item summary::after {
  content: '+';
  color: var(--gold);
  font-size: 1.2rem;
  flex: 0 0 auto;
}

.faq__item[open] summary::after {
  content: '−';
}

.faq__item p {
  color: var(--dim);
  margin: 0 0 14px;
  font-size: 0.92rem;
}

/* ---------- footer ---------- */

.footer {
  text-align: center;
  padding: 30px 16px 50px;
  color: var(--dim);
  font-size: 0.85rem;
}

.footer a {
  color: var(--dim);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--gold);
}

/* ---------- utilidades ---------- */

.fx-num {
  font-family: var(--font-display);
}

/* ---------- pantallas más anchas ---------- */

@media (min-width: 640px) {
  .steps {
    flex-direction: row;
  }

  .step {
    flex: 1;
  }
}

/* ---------- prefers-reduced-motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .hero__coin {
    animation: none;
  }
}
