/* ==========================================================================
   Dumbo Growth Lab — Componentes
   Piezas reutilizables: botones, campos, media-facade, nodo de recorrido, chips.
   ========================================================================== */

/* --- Botones ----------------------------------------------------------------- */

.btn {
  --_bg: var(--ink);
  --_fg: var(--paper);
  --_bd: var(--ink);
  --_scale: 1;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.9em 1.55em;
  font-family: var(--font-display);
  font-size: var(--step-0);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--_fg);
  background: var(--_bg);
  border: var(--rule-w) solid var(--_bd);
  border-radius: var(--radius-btn);
  cursor: pointer;
  transform: translateY(0) scale(var(--_scale));
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
  text-align: center;
}
.btn:hover { --_scale: 1.015; transform: translateY(-2px) scale(var(--_scale)); }
.btn:active { --_scale: 0.985; transform: translateY(0) scale(var(--_scale)); }

/* Primario sobre fondo claro */
.btn--primary { --_bg: var(--ink); --_fg: var(--paper); --_bd: var(--ink); }
.btn--primary:hover { --_bd: var(--green); }

/* Primario sobre fondo oscuro (secciones data-theme="dark" y header, siempre oscuro) */
[data-theme="dark"] .btn--primary,
.site-header .btn--primary,
.btn--on-dark {
  --_bg: var(--paper);
  --_fg: var(--ink);
  --_bd: var(--paper);
}
/* Hover: el botón NO se rellena de verde (así se distingue del cursor verde).
   Se queda blanco y solo aparece un borde fino verde (--green = #98B572). */
[data-theme="dark"] .btn--primary:hover,
.site-header .btn--primary:hover,
.btn--on-dark:hover { --_bd: var(--green); }

/* Secundario: contorno, con borde verde fino al hover (sin relleno) */
.btn--ghost {
  --_bg: transparent;
  --_fg: var(--fg);
  --_bd: currentColor;
}
.btn--ghost:hover { --_bd: var(--green); }
[data-theme="dark"] .btn--ghost:hover { --_bd: var(--green); }

/* Enlace con flecha (acento azul reservado para el recorrido/CTA secundaria) */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--fg);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.link-arrow .arrow { color: var(--accent); transition: transform var(--dur) var(--ease); }
.link-arrow:hover { border-color: var(--accent); }
.link-arrow:hover .arrow { transform: translate(3px, -3px); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

/* --- Chips / etiquetas de público ------------------------------------------ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.5em 0.9em;
  font-size: var(--step--1);
  letter-spacing: 0.02em;
  color: var(--fg);
  border: var(--rule-w) solid var(--rule);
  border-radius: 999px;
}
.chip::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--sage);
  border-radius: 50%;
  flex: none;
}
.chip-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* --- Media facade (vídeo diferido) ---------------------------------------- */
.media {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: var(--ink);
  border: var(--rule-w) solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.media__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}
.media__btn {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
}
.media__btn:hover .media__play { transform: scale(1.06); background: var(--green); border-color: var(--green); color: var(--ink); }
.media__play {
  width: clamp(60px, 8vw, 84px);
  height: clamp(60px, 8vw, 84px);
  display: grid;
  place-items: center;
  border: 1px solid var(--paper);
  border-radius: 50%;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.media__play svg { width: 34%; height: auto; margin-left: 12%; fill: currentColor; }
.media__label {
  position: absolute;
  left: var(--space-4);
  bottom: var(--space-4);
  font-family: var(--font-display);
  font-size: var(--step--1);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--paper-70);
}
.media__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media.is-playing .media__poster,
.media.is-playing .media__btn,
.media.is-playing .media__label { display: none; }

/* --- Nodo de recorrido (Propuesta de valor / Método) --------------------- */
.node {
  border: var(--rule-w) solid var(--rule);
  border-radius: var(--radius);
  padding: var(--space-4);
  background: var(--bg);
}
.node__index {
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--sage);
}
.node__title {
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.node__text {
  margin-top: var(--space-2);
  font-size: var(--step--1);
  color: var(--muted);
  line-height: 1.55;
}

/* --- Campos de formulario ------------------------------------------------- */
.field { display: grid; gap: var(--space-2); }
.field__label {
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--fg);
}
.field__label .req { color: var(--accent); }
.field__hint { font-size: 0.8rem; color: var(--muted); }

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.9em 1em;
  font-family: var(--font-display);
  font-size: var(--step-0);
  color: var(--fg);
  background: var(--field-bg);
  border: var(--rule-w) solid var(--field-bd);
  border-radius: var(--radius);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  min-height: 48px;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23121211' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1em center;
  padding-right: 2.6em;
}
[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23FFFFFF' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 91, 255, 0.16);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }

/* Estado de error (lo activa form.js) */
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea { border-color: #b4321f; }
.field__error {
  font-size: 0.8rem;
  color: #b4321f;
  display: none;
}
.field.has-error .field__error { display: block; }

/* Honeypot */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* Checkbox de consentimiento */
.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
  font-size: 0.85rem;
  color: var(--muted);
}
.consent input { margin-top: 0.2em; width: 18px; height: 18px; accent-color: var(--accent); }
.consent a { color: var(--fg); border-bottom: 1px solid var(--rule); }

/* --- Barra de progreso del formulario ----------------------------------- */
.progress {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--step--1);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
}
.progress__track {
  flex: 1;
  height: 2px;
  background: var(--rule);
  position: relative;
  overflow: hidden;
}
.progress__bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  background: var(--accent);
  transition: width var(--dur) var(--ease);
}

/* --- Cursor personalizado --------------------------------------------------
   Puntito con halo que sigue al mouse con un leve retardo. Azul por defecto;
   pasa a verde sobre cualquier elemento cliqueable (links, botones, tarjetas,
   selects…). Solo en escritorio con mouse real, y solo si main.js lo pudo
   inicializar (clase .has-custom-cursor en <html>) — si falla, se ve el
   cursor normal del sistema. Con prefers-reduced-motion se desactiva. */
@media (hover: hover) and (pointer: fine) {
  .has-custom-cursor,
  .has-custom-cursor a,
  .has-custom-cursor button,
  .has-custom-cursor select,
  .has-custom-cursor summary,
  .has-custom-cursor label,
  .has-custom-cursor [role="button"],
  .has-custom-cursor input[type="checkbox"],
  .has-custom-cursor input[type="radio"],
  .has-custom-cursor input[type="submit"],
  .has-custom-cursor input[type="button"],
  .has-custom-cursor .stage-card {
    cursor: none;
  }
  /* campos de texto: se mantiene el cursor de texto normal, no el puntito */
  .has-custom-cursor input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
  .has-custom-cursor textarea {
    cursor: auto;
  }

  /* Tres capas: (1) el halo — degradado del color vivo cerca del centro a
     un tono más oscuro al expandirse, hasta transparente; (2) ::before, el
     aro fino y definido; (3) ::after, el punto central sólido. */
  .cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    will-change: transform;
    background: radial-gradient(circle at 50% 50%,
      rgba(110, 147, 255, 0.70) 12%,
      rgba(45, 91, 255, 0.55) 40%,
      rgba(22, 41, 122, 0.34) 66%,
      rgba(16, 28, 82, 0) 92%);
    transition: opacity 220ms var(--ease-out), background 180ms linear;
  }
  .cursor.is-visible { opacity: 1; }
  .cursor::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 13px;
    height: 13px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid #2D5BFF;
    transition: border-color 180ms linear;
  }
  .cursor::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #E6EBFA;
    transition: background-color 180ms linear;
  }
  .cursor.is-interactive {
    background: radial-gradient(circle at 50% 50%,
      rgba(191, 216, 150, 0.70) 12%,
      rgba(152, 181, 114, 0.55) 40%,
      rgba(90, 112, 64, 0.34) 66%,
      rgba(58, 74, 42, 0) 92%);
  }
  .cursor.is-interactive::before { border-color: #98B572; }
  .cursor.is-interactive::after { background: #EDF2E4; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor { display: none !important; }
}
