/* ═══════════════════════════════════════════════════════════
   BLUECODE STUDIOS — Formulario de estrategia (estilo Typeform)
   ═══════════════════════════════════════════════════════════ */

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

:root {
  --bg: #0a0a0a;
  --fg: #ffffff;
  --fg-60: rgba(255, 255, 255, 0.6);
  --fg-40: rgba(255, 255, 255, 0.4);
  --fg-30: rgba(255, 255, 255, 0.3);
  --border: rgba(255, 255, 255, 0.1);
  --surface: rgba(255, 255, 255, 0.05);
  --blue-dark: #24366B;
  --blue-mid: #3d74f2;
  --blue-light: #6b9dff;
  --blue-pale: #B9C9EF;
  --grad: linear-gradient(90deg, var(--blue-dark), var(--blue-mid), var(--blue-light));
  --grad-text: linear-gradient(90deg, #5984e8, var(--blue-mid) 40%, var(--blue-pale));
  --radius: 0.625rem;
  --font-sans: 'Geist', system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

::selection { background: rgba(61, 116, 242, 0.4); color: var(--fg); }

/* ── Barra de progreso ── */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
  z-index: 50;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(61, 116, 242, 0.6);
  transition: width 0.5s var(--ease-out);
}

/* ── Header ── */
.form-header {
  position: fixed;
  top: 4px; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
}
.form-logo {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--fg);
  text-decoration: none;
}
.form-logo span {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.form-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg-60);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.form-close:hover { color: var(--fg); border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.08); }

/* ── Glow de fondo ── */
.form-glow {
  position: fixed;
  bottom: -40%; right: -15%;
  width: 800px; height: 700px;
  background: radial-gradient(ellipse at center, rgba(61, 116, 242, 0.12), transparent 65%);
  filter: blur(48px);
  pointer-events: none;
}

/* ── Stage y slides ── */
.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
}
.q {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 24px 120px;
  visibility: hidden;
  opacity: 0;
}
.q.is-active { visibility: visible; opacity: 1; }
.q-inner { width: min(680px, 100%); }
.q-inner-center { text-align: center; }

.q-num {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--blue-light);
  margin-bottom: 14px;
}
.q-num svg { width: 14px; height: 14px; }

.q-title {
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  text-wrap: balance;
}
.q-title [data-pipe] {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}
.q-desc {
  font-size: 16px;
  color: var(--fg-60);
  margin-bottom: 8px;
}

/* ── Inputs ── */
.q-input {
  width: 100%;
  margin-top: 22px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--font-sans);
  font-size: clamp(20px, 2.8vw, 28px);
  font-weight: 400;
  color: var(--fg);
  padding: 8px 0 10px;
  outline: none;
  border-radius: 0;
  transition: border-color 0.25s, box-shadow 0.25s;
  caret-color: var(--blue-mid);
}
.q-input::placeholder { color: var(--fg-30); }
.q-input:focus {
  border-bottom-color: var(--blue-mid);
  box-shadow: 0 1px 0 0 var(--blue-mid);
}
.q-textarea {
  resize: none;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
  min-height: 90px;
}

/* ── Opciones (estilo Typeform) ── */
.q-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 26px;
  max-width: 460px;
}
.q-opts-inline { flex-direction: row; max-width: 320px; }
.q-opts-inline .opt { flex: 1; }
.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(107, 157, 255, 0.45);
  background: rgba(61, 116, 242, 0.1);
  border-radius: 8px;
  padding: 11px 14px;
  font-family: var(--font-sans);
  font-size: 17px;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s var(--ease-out);
}
.opt:hover { background: rgba(61, 116, 242, 0.2); }
.opt:active { transform: scale(0.99); }
.opt-key {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  flex-shrink: 0;
  border: 1px solid rgba(107, 157, 255, 0.5);
  border-radius: 4px;
  background: rgba(10, 10, 10, 0.55);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--blue-pale);
}
.opt-label { flex: 1; }
.opt-check {
  width: 18px; height: 18px;
  color: var(--fg);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s, transform 0.2s var(--ease-out);
}
.opt.is-selected {
  background: rgba(61, 116, 242, 0.32);
  border-color: var(--blue-light);
  box-shadow: 0 0 0 1px var(--blue-light) inset;
}
.opt.is-selected .opt-key {
  background: var(--blue-mid);
  border-color: var(--blue-light);
  color: #fff;
}
.opt.is-selected .opt-check { opacity: 1; transform: scale(1); }
.opt.flash { animation: optFlash 0.4s ease 2; }
@keyframes optFlash {
  50% { background: rgba(61, 116, 242, 0.5); }
}

/* ── Sub-campo condicional ── */
.q-sub[hidden] { display: none; }

/* ── Acciones ── */
.q-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
}
.q-actions[hidden] { display: none; }
.q-ok {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--grad);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  padding: 11px 26px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(107, 157, 255, 0.25) inset, 0 8px 28px rgba(61, 116, 242, 0.25);
  transition: box-shadow 0.3s, transform 0.2s var(--ease-out);
}
.q-ok:hover {
  box-shadow: 0 0 0 1px rgba(107, 157, 255, 0.4) inset, 0 12px 40px rgba(61, 116, 242, 0.45);
  transform: translateY(-1px);
}
.q-ok svg { width: 15px; height: 15px; }
.q-hint { font-size: 13.5px; color: var(--fg-40); }
.q-hint b { color: var(--fg-60); font-weight: 600; }

/* ── Error ── */
.q-error {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 500;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  padding: 7px 14px;
  animation: shake 0.4s var(--ease-out);
}
.q-error[hidden] { display: none; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ── Final ── */
.final-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px; height: 72px;
  margin: 0 auto 28px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 48px rgba(61, 116, 242, 0.5);
}
.final-check svg { width: 32px; height: 32px; color: #fff; }
.q-final .q-desc { max-width: 440px; margin: 0 auto; }

/* ── Footer: marca + flechas ── */
.form-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
}
.form-brand {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--fg-30);
}
.form-brand b { color: var(--fg-40); font-weight: 500; }
.form-arrows { display: flex; gap: 4px; }
.form-arrows button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border: none;
  background: var(--grad);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.25s, filter 0.2s;
}
.form-arrows button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.form-arrows button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.form-arrows button:hover:not(:disabled) { filter: brightness(1.15); }
.form-arrows button:disabled { opacity: 0.35; cursor: default; }
.form-arrows svg { width: 18px; height: 18px; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .q { padding: 84px 20px 110px; }
  .q-title { font-size: 22px; }
  .q-input { font-size: 19px; }
  .q-opts { max-width: 100%; }
  .q-opts-inline { max-width: 260px; }
  .opt { font-size: 16px; padding: 10px 12px; }
  .q-actions { flex-wrap: wrap; gap: 10px; }
  .q-hint { display: none; }
  .form-header { padding: 16px 20px; }
  .form-footer { padding: 16px 20px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
