/* Brief Galiax. Móvil primero: el enlace se abre desde WhatsApp.
   Marca: violeta de los banners de bygaliax.com + Poppins (títulos, peso ligero) + DM Sans. */

@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-latin.woff2') format('woff2');
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  src: url('/fonts/poppins-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  src: url('/fonts/poppins-500-latin.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --violet: #3a12d3;
  --violet-deep: #240a93;
  --violet-hover: #2f0cc0;
  --electric: #4048fe;
  --ink: #16142a;
  --muted: #5d5b72;
  --paper: #f4f4fb;
  --surface: #fdfdff;
  --line: #dcdced;
  --line-strong: #b8b7d4;
  --tint: #ecedff;
  --error: #b3263f;
  --error-bg: #fbe9ed;
  --on-violet: #f7f6ff;
  --on-violet-muted: rgb(247 246 255 / 0.76);
  --radius-sm: 10px;
  --radius: 14px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --font-body: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Poppins', var(--font-body);
  --gutter: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  z-index: 20;
  left: 12px;
  top: -60px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

/* ---------- Estructura ---------- */

.layout {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.brand {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: var(--on-violet);
  background:
    radial-gradient(110% 80% at 100% 0%, rgb(104 84 255 / 0.5) 0%, rgb(104 84 255 / 0) 60%),
    linear-gradient(165deg, var(--violet) 0%, var(--violet-deep) 100%);
  padding: max(16px, env(safe-area-inset-top)) var(--gutter) 24px;
}

.brand__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand__logo {
  display: block;
  border-radius: 6px;
}
.brand__logo img {
  width: 104px;
}
.brand__logo:focus-visible,
.brand__foot a:focus-visible {
  outline: 2px solid var(--on-violet);
  outline-offset: 4px;
}

.lang {
  min-width: 48px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.08);
  color: var(--on-violet);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background-color 0.15s var(--ease);
}
.lang:hover {
  background: rgb(255 255 255 / 0.16);
}
.lang:focus-visible {
  outline: 2px solid var(--on-violet);
  outline-offset: 3px;
}

.brand__intro {
  margin-top: 28px;
  max-width: 34rem;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-violet-muted);
}

.brand h1 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(1.75rem, 1.25rem + 2.2vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.brand__lead {
  margin: 12px 0 0;
  max-width: 40ch;
  color: var(--on-violet-muted);
}

.brand__meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 16px 0 0;
  padding: 0;
  font-size: 0.8125rem;
  color: var(--on-violet-muted);
}
.brand__meta li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand__meta li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a9adff;
}

.index,
.brand__foot,
.brand__mark {
  display: none;
}

.work {
  flex: 1;
  padding: 22px var(--gutter) 0;
  outline: none;
}

.brief {
  max-width: 40rem;
  margin: 0 auto;
}

.noscript {
  max-width: 40rem;
  margin: 0 auto;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
}

/* ---------- Progreso ---------- */

.progress {
  margin-bottom: 22px;
}
.progress__label {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.progress__track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}
.progress__bar {
  height: 100%;
  border-radius: inherit;
  background: var(--electric);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s var(--ease);
}

/* ---------- Paso ---------- */

.step,
.done {
  animation: enter 0.42s var(--ease) both;
}
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.step__title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
  outline: none;
}

.step__lead {
  margin: 8px 0 0;
  max-width: 52ch;
  color: var(--muted);
}

.step__fields {
  display: grid;
  gap: 28px;
  margin-top: 28px;
}

.field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.field[hidden] {
  display: none;
}

.field__label {
  display: block;
  margin-bottom: 10px;
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
}
.field__opt {
  margin-left: 6px;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--muted);
}

.field input:not([type='radio']):not([type='checkbox']),
.field textarea {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 1rem; /* 16px: iOS no hace zoom al enfocar */
  line-height: 1.4;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.field textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.5;
}
.field input::placeholder,
.field textarea::placeholder {
  color: #8d8ba3;
  opacity: 1;
}
.field input:not([type='radio']):not([type='checkbox']):focus,
.field textarea:focus {
  outline: none;
  border-color: var(--electric);
  box-shadow: 0 0 0 3px rgb(64 72 254 / 0.18);
}

.has-error input:not([type='radio']):not([type='checkbox']),
.has-error textarea {
  border-color: var(--error);
}

.field__error {
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: var(--error);
}
.field__error:empty {
  display: none;
}

/* ---------- Opciones (radio y casillas con su input real, accesible por teclado) ---------- */

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice {
  position: relative;
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.choice input {
  position: absolute;
  top: 50%;
  left: 18px;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.choice__box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 16px 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9375rem;
  line-height: 1.3;
  transition:
    border-color 0.15s var(--ease),
    background-color 0.15s var(--ease),
    box-shadow 0.15s var(--ease),
    transform 0.12s var(--ease);
}

/* Indicador: círculo en las de una opción, cuadrado en las de varias */
.choice__box::before {
  content: '';
  flex: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface) center / 12px no-repeat;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.choice--checks .choice__box::before {
  border-radius: 5px;
}

@media (hover: hover) {
  .choice:hover .choice__box {
    border-color: #8f8cc4;
  }
}

.choice:active .choice__box {
  transform: scale(0.98);
}

.choice input:checked + .choice__box {
  border-color: var(--electric);
  background: var(--tint);
  box-shadow: inset 0 0 0 1px var(--electric);
}
.choice input:checked + .choice__box::before {
  border-color: var(--electric);
  background-color: var(--electric);
  box-shadow: inset 0 0 0 3.5px var(--surface);
}
.choice--checks input:checked + .choice__box::before {
  box-shadow: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fdfdff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.choice input:focus-visible + .choice__box {
  outline: 3px solid rgb(64 72 254 / 0.4);
  outline-offset: 2px;
}

.has-error .choice__box {
  border-color: rgb(179 38 63 / 0.55);
}

/* Casillas: rejilla de 2 columnas desde ~340px, se leen mejor que píldoras sueltas */
.choices--checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
}
.choices--checks .choice__box {
  height: 100%;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

/* Tarjetas (tipo de web): título + descripción */
.choices--cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.choices--cards .choice__box {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  row-gap: 3px;
  align-items: start;
  align-content: start; /* si la fila es más alta por la tarjeta vecina, el texto no se reparte */
  height: 100%;
  padding: 14px 16px 15px 14px;
  border-radius: var(--radius);
}
.choices--cards .choice__box::before {
  grid-row: span 2;
  margin-top: 2px;
}
.choice__title {
  font-weight: 500;
  font-size: 1rem;
}
.choice__desc {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- Errores y consentimiento ---------- */

.step__error {
  margin: 20px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--error-bg);
  color: var(--error);
  font-size: 0.9375rem;
}
.step__error:empty {
  display: none;
}
.step__error a {
  color: inherit;
  font-weight: 500;
  text-underline-offset: 2px;
}

.consent {
  margin: 24px 0 0;
  max-width: 52ch;
  font-size: 0.8125rem;
  color: var(--muted);
}
.consent a {
  color: var(--ink);
  text-underline-offset: 2px;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ---------- Botones ---------- */

.actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px calc(var(--gutter) * -1) 0;
  padding: 14px var(--gutter) max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 75%, rgb(244 244 251 / 0));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), transform 0.12s var(--ease), opacity 0.15s var(--ease);
}
.btn:active {
  transform: scale(0.98);
}
.btn:focus-visible {
  outline: 3px solid rgb(64 72 254 / 0.45);
  outline-offset: 3px;
}
.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.btn--primary {
  flex: 1;
  background: var(--violet);
  color: var(--on-violet);
}
@media (hover: hover) {
  .btn--primary:hover {
    background: var(--violet-hover);
  }
  .btn--ghost:hover {
    background: rgb(22 20 42 / 0.06);
  }
}

.btn--ghost {
  flex: none;
  padding: 0 18px;
  background: transparent;
  color: var(--ink);
}

/* ---------- Enviado ---------- */

.done {
  padding: 8px 0 48px;
}
.done__mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--tint);
}
.done__mark::before {
  content: '';
  width: 20px;
  height: 11px;
  border-bottom: 2.5px solid var(--electric);
  border-left: 2.5px solid var(--electric);
  transform: translateY(-2px) rotate(-45deg);
}
.done__alt {
  margin: 32px 0 12px;
  color: var(--muted);
}
.btn--wa {
  flex: none;
}

/* ---------- Móvil: a partir del paso 2 la cabecera se compacta ---------- */

@media (max-width: 959.98px) {
  .is-compact .brand {
    padding-bottom: 16px;
  }
  .is-compact .brand__intro {
    margin: 0;
  }
  .is-compact .eyebrow,
  .is-compact .brand__lead,
  .is-compact .brand__meta {
    display: none;
  }
  .is-compact .brand h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ---------- Escritorio: panel de marca fijo a la izquierda ---------- */

@media (min-width: 640px) {
  .choices--cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  :root {
    --gutter: clamp(40px, 5vw, 88px);
  }

  .layout {
    display: grid;
    grid-template-columns: minmax(360px, 40%) 1fr;
  }

  .brand {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    padding: 40px 48px 36px;
  }
  .brand__logo img {
    width: 120px;
  }
  .brand__intro {
    margin-top: clamp(40px, 11vh, 120px);
  }

  .index {
    display: block;
    margin-top: 40px;
  }
  .index ol {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .index button {
    display: flex;
    align-items: center;
    gap: 14px;
    width: calc(100% + 12px);
    margin-left: -12px;
    padding: 8px 12px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--on-violet-muted);
    font-size: 0.9375rem;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
  }
  .index button:disabled {
    cursor: default;
  }
  .index button:not(:disabled):hover {
    background: rgb(255 255 255 / 0.08);
    color: var(--on-violet);
  }
  .index button:focus-visible {
    outline: 2px solid var(--on-violet);
    outline-offset: 2px;
  }
  .index__num {
    width: 22px;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
    opacity: 0.8;
  }
  .is-todo button {
    color: rgb(247 246 255 / 0.6);
  }
  .is-current button {
    background: rgb(255 255 255 / 0.12);
    color: var(--on-violet);
  }
  .is-done .index__label::after {
    content: '';
    display: inline-block;
    width: 9px;
    height: 5px;
    margin-left: 10px;
    border-bottom: 1.5px solid currentColor;
    border-left: 1.5px solid currentColor;
    transform: translateY(-3px) rotate(-45deg);
  }

  .brand__foot {
    display: flex;
    gap: 10px;
    margin: auto 0 0;
    padding-top: 28px;
    font-size: 0.8125rem;
    color: var(--on-violet-muted);
  }
  .brand__foot a {
    text-decoration: none;
    border-radius: 4px;
  }
  .brand__foot a:hover {
    color: var(--on-violet);
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .brand__mark {
    display: block;
    position: absolute;
    z-index: -1;
    right: -90px;
    bottom: -70px;
    width: 380px;
    opacity: 0.06;
    pointer-events: none;
  }

  .work {
    padding: clamp(48px, 9vh, 104px) var(--gutter) 0;
  }
  .brief {
    margin: 0;
    max-width: 38rem;
  }

  .actions {
    margin: 36px 0 0;
    padding: 20px 0 max(32px, env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--paper) 80%, rgb(244 244 251 / 0));
  }
  .btn--primary {
    flex: none;
    min-width: 11rem;
    margin-left: auto;
  }
  .btn--ghost {
    margin-left: -18px;
  }
  .btn--wa {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .step,
  .done {
    animation: none;
  }
  .progress__bar,
  .btn,
  .choice__box,
  .choice__box::before {
    transition: none;
  }
}
