/* ════════════════════════════════════════════════════════════════════════
   Tokens de marca Chillypills — EDITA ESTAS LÍNEAS PARA REBRANDEAR
   Marca actual: fondo blanco, acento negro (minimalista B/N).
   ════════════════════════════════════════════════════════════════════════ */
:root {
  --color-primary: #000000;     /* acento principal (botones, foco) */
  --color-secondary: #444444;   /* texto secundario / ayudas */
  --color-bg: #ffffff;          /* fondo */
  --color-text: #0a0a0a;        /* texto principal */
  --color-line: #e6e6e6;        /* bordes sutiles */
  --color-error: #d12f2f;       /* errores de validación */
  --font-main: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius: 12px;
  --maxw: 680px;
}

/* ─── Base ─────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
a { color: var(--color-primary); }
kbd {
  font-family: inherit; font-size: .8em; background: #f2f2f2;
  border: 1px solid var(--color-line); border-radius: 6px; padding: 1px 6px;
}

/* ─── Barra de progreso ─────────────────────────────────────────────────── */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; background: var(--color-line); z-index: 20; }
.progress__bar { height: 100%; width: 0; background: var(--color-primary); transition: width .35s ease; }

/* ─── Topbar ────────────────────────────────────────────────────────────── */
.topbar { padding: 22px clamp(18px, 5vw, 48px) 0; flex: 0 0 auto; }
.topbar__logo { height: 26px; width: auto; }

/* ─── Stage / pantallas ─────────────────────────────────────────────────── */
.stage {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 5vw, 56px);
  width: 100%;
}
.loading { color: var(--color-secondary); }

.screen {
  width: 100%;
  max-width: var(--maxw);
  animation: slideIn .4s cubic-bezier(.16,.84,.44,1);
}
.screen.is-leaving { animation: slideOut .25s ease forwards; }
@keyframes slideIn { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateY(-20px); } }
@media (prefers-reduced-motion: reduce) {
  .screen, .screen.is-leaving { animation: none; }
  .progress__bar { transition: none; }
}

/* ─── Pregunta ──────────────────────────────────────────────────────────── */
.q__count { font-size: .85rem; color: var(--color-secondary); margin-bottom: 10px; letter-spacing: .02em; }
.q__count .req { color: var(--color-error); }
.q__label {
  font-size: clamp(1.4rem, 3.6vw, 2rem);
  line-height: 1.25; font-weight: 600; margin: 0 0 10px;
}
.q__help { color: var(--color-secondary); font-size: 1rem; margin: 0 0 24px; line-height: 1.5; }

/* ─── Campos ────────────────────────────────────────────────────────────── */
.field { width: 100%; }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
textarea, select {
  width: 100%;
  font-family: inherit;
  font-size: 1.15rem;
  color: var(--color-text);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--color-line);
  padding: 12px 2px;
  outline: none;
  transition: border-color .2s;
}
textarea { resize: vertical; min-height: 90px; border: 2px solid var(--color-line); border-radius: var(--radius); padding: 14px; }
select {
  border: 2px solid var(--color-line); border-radius: var(--radius); padding: 14px;
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23444' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
input:focus, textarea:focus, select:focus { border-color: var(--color-primary); }
input::placeholder, textarea::placeholder { color: #b3b3b3; }

/* Opciones (select tipo lista / multiselect) */
.options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid var(--color-line); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer; font-size: 1.05rem;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.opt:hover { border-color: #bdbdbd; }
.opt.is-selected { border-color: var(--color-primary); background: #fafafa; }
.opt__key {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px;
  border: 1.5px solid var(--color-line); display: grid; place-items: center;
  font-size: .8rem; color: var(--color-secondary);
}
.opt.is-selected .opt__key { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.opt input { display: none; }

/* Escala (slider entre dos adjetivos) */
.scale { margin-top: 8px; }
.scale__labels { display: flex; justify-content: space-between; font-size: .95rem; color: var(--color-secondary); margin-bottom: 14px; }
.scale__row { display: flex; gap: 10px; }
.scale__dot {
  flex: 1; aspect-ratio: 1; max-width: 64px; border: 2px solid var(--color-line);
  border-radius: 50%; background: transparent; cursor: pointer; font-size: 1.05rem;
  color: var(--color-secondary); transition: all .15s;
}
.scale__dot:hover { border-color: #bdbdbd; }
.scale__dot.is-selected { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* Colores */
.colors { display: flex; flex-direction: column; gap: 14px; }
.colors__list { display: flex; flex-wrap: wrap; gap: 10px; }
.colors__chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--color-line); border-radius: 999px; padding: 4px 10px 4px 4px; font-size: .9rem;
}
.colors__sw { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0,0,0,.1); }
.colors__rm { border: none; background: none; cursor: pointer; color: var(--color-secondary); font-size: 1.1rem; line-height: 1; }
.colors__add { display: flex; align-items: center; gap: 10px; }
.colors__add input[type="color"] { width: 52px; height: 40px; border: 1px solid var(--color-line); border-radius: 10px; padding: 2px; background: #fff; cursor: pointer; }

/* Subida de archivo */
.filefield { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.filefield .btn { border: 2px solid var(--color-line); }
.filefield__status { font-size: .98rem; color: var(--color-secondary); min-height: 1.4em; }
.filefield__chip { display: inline-flex; align-items: center; gap: 8px; background: #fafafa; border: 1px solid var(--color-line); border-radius: 999px; padding: 6px 8px 6px 14px; color: var(--color-text); }
.filefield__size { color: var(--color-secondary); font-size: .85em; }
.filefield__rm { border: none; background: none; cursor: pointer; color: var(--color-secondary); font-size: 1.2rem; line-height: 1; padding: 0 4px; }
.filefield__err { color: var(--color-error); }

/* Consentimiento */
.consent { display: flex; gap: 14px; align-items: flex-start; border: 2px solid var(--color-line); border-radius: var(--radius); padding: 18px; cursor: pointer; }
.consent.is-selected { border-color: var(--color-primary); background: #fafafa; }
.consent input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--color-primary); flex: 0 0 auto; }
.consent__text { font-size: .98rem; line-height: 1.5; color: var(--color-text); }

/* Error de validación */
.field__error { color: var(--color-error); font-size: .92rem; margin-top: 12px; min-height: 1.2em; }

/* ─── Intro y agradecimiento ───────────────────────────────────────────── */
.cover { text-align: left; }
.cover h1 { font-size: clamp(1.9rem, 6vw, 3rem); line-height: 1.1; margin: 0 0 18px; font-weight: 700; }
.cover p { font-size: 1.15rem; color: var(--color-secondary); line-height: 1.55; margin: 0 0 32px; max-width: 56ch; }
.thanks { text-align: center; }
.thanks h1 { font-size: clamp(2rem, 7vw, 3.2rem); margin: 0 0 16px; }
.thanks p { font-size: 1.15rem; color: var(--color-secondary); line-height: 1.6; max-width: 52ch; margin: 0 auto; }
.thanks__logo { height: 30px; margin-top: 36px; }

/* ─── Botones ──────────────────────────────────────────────────────────── */
.btn {
  font-family: inherit; font-size: 1rem; font-weight: 600;
  border-radius: var(--radius); padding: 13px 26px; cursor: pointer;
  border: 2px solid transparent; transition: transform .08s, opacity .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { opacity: .88; }
.btn--ghost { background: transparent; color: var(--color-secondary); border-color: transparent; }
.btn--ghost:hover { color: var(--color-text); }
.btn--lg { font-size: 1.1rem; padding: 16px 34px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ─── Navegación inferior ──────────────────────────────────────────────── */
.nav {
  position: sticky; bottom: 0; flex: 0 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 16px clamp(18px, 5vw, 48px);
  background: linear-gradient(to top, var(--color-bg) 70%, transparent);
  border-top: 1px solid var(--color-line);
}
.nav__spacer { flex: 1; }
.nav__hint { font-size: .85rem; color: var(--color-secondary); }
@media (max-width: 540px) {
  .nav__hint { display: none; }
}

/* ─── Estado de envío ──────────────────────────────────────────────────── */
.alert { background: #fdecec; color: var(--color-error); border: 1px solid #f5b5b5; border-radius: var(--radius); padding: 14px 16px; margin-top: 18px; font-size: .95rem; }
