/* ==========================================================================
   Galaxy Media — Diagnóstico de Posicionamento (Quiz)
   Tokens espelhados de site.wegalaxymedia.com
   ========================================================================== */

:root {
  --c-black: #020104;
  --c-surface: #0C0718;
  --c-panel: #0D0A14;
  --c-deep: #1C123A;
  --c-primary: #7043DD;
  --c-primary-hover: #7E52E8;
  --c-light: #A884F0;
  --c-offwhite: #F2EEFC;
  --c-muted: #786C94;
  --c-muted-up: #9C99A6;
  --c-muted-down: #5E5B68;

  --border: rgba(242, 238, 252, 0.08);
  --border-strong: rgba(242, 238, 252, 0.16);
  --border-accent: rgba(112, 67, 221, 0.35);

  --font-sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-normal: 280ms;
  --dur-slow: 600ms;

  --page-pad: clamp(20px, 5vw, 64px);
  --track-title: -0.032em;
  --track-label: 0.08em;
  --track-wide: 0.12em;

  --cruz: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9'%3E%3Cpath d='M4.5 0v9M0 4.5h9' stroke='%23F2EEFC' stroke-opacity='.16' stroke-width='.9'/%3E%3C/svg%3E");
  --cruz-acento: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9'%3E%3Cpath d='M4.5 0v9M0 4.5h9' stroke='%23A884F0' stroke-opacity='.85' stroke-width='1'/%3E%3C/svg%3E");
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--c-black);
  color: var(--c-offwhite);
  font: 400 1rem/1.6 var(--font-sans);
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button, input { font: inherit; color: inherit; }
::selection { background: var(--c-primary); color: #fff; }
[tabindex="-1"]:focus { outline: none; }

/* ---------- Fundo (mesmo gradiente do hero do site) ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(148.65% 122.74% at 39.83% 4.07%,
    #020104 0%, #020104 34.84%,
    rgba(20, 10, 35, 0.97) 57%,
    rgba(55, 25, 115, 0.92) 73%,
    #7043DD 100%);
  transition: opacity 900ms var(--ease-io);
}
body[data-phase="q"] .bg,
body[data-phase="contact"] .bg { opacity: 0.5; }

/* ---------- Estrutura ---------- */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px var(--page-pad) 0;
}

.logo { width: 104px; color: var(--c-offwhite); line-height: 0; }
.logo svg { display: block; width: 100%; height: auto; }

.progress {
  position: relative;
  width: min(640px, 100%);
  height: 1px;
  margin-top: 26px;
  background: var(--border);
  opacity: 0;
  transition: opacity var(--dur-normal) var(--ease-io);
}
body[data-phase="q"] .progress,
body[data-phase="contact"] .progress,
body[data-phase="loading"] .progress { opacity: 1; }
.progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--c-primary);
  box-shadow: 0 0 12px rgba(112, 67, 221, 0.8);
  transition: width var(--dur-slow) var(--ease-out);
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 688px;
  margin: 0 auto;
  padding: clamp(36px, 7vh, 80px) var(--page-pad) 40px;
}

.foot {
  display: flex;
  justify-content: center;
  gap: 10px 24px;
  flex-wrap: wrap;
  padding: 0 var(--page-pad) 28px;
  font: 400 11px/1.6 var(--font-mono);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--c-muted-down);
}

/* ---------- Transições ---------- */
.screen { position: relative; animation: in var(--dur-slow) var(--ease-out) both; }
.screen.out { animation: out 200ms var(--ease-io) both; }
.stagger > * { animation: in 700ms var(--ease-out) both; }
.stagger > *:nth-child(2) { animation-delay: 60ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 180ms; }
.stagger > *:nth-child(5) { animation-delay: 240ms; }
.stagger > *:nth-child(6) { animation-delay: 300ms; }
.stagger > *:nth-child(7) { animation-delay: 360ms; }

@keyframes in  { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes out { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- Tipografia ---------- */
.eyebrow {
  margin: 0;
  font: 500 11px/1.6 var(--font-mono);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--c-light);
}

h1, h2 {
  margin: 0;
  font-weight: 500;
  letter-spacing: var(--track-title);
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.1; }
h2 { font-size: clamp(1.45rem, 3.2vw, 2.05rem); line-height: 1.2; }

.lead {
  margin: 0;
  max-width: 34rem;
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  font-weight: 300;
  line-height: 1.75;
  letter-spacing: -0.011em;
  color: var(--c-muted-up);
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 54px;
  padding: 0 34px;
  border: 0;
  border-radius: 4px;
  background: var(--c-primary);
  color: var(--c-offwhite);
  font: 500 13px/1 var(--font-mono);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-io),
              box-shadow var(--dur-normal) var(--ease-io),
              opacity var(--dur-fast) var(--ease-io),
              transform var(--dur-fast) var(--ease-io);
}
.btn:hover { background: var(--c-primary-hover); box-shadow: 0 10px 36px rgba(112, 67, 221, 0.38); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--c-light); outline-offset: 3px; }
.btn[disabled] { opacity: 0.35; pointer-events: none; }
.btn .arr { display: inline-block; transition: transform var(--dur-normal) var(--ease-out); }
.btn:hover .arr { transform: translateX(3px); }

.link {
  padding: 10px 0;
  border: 0;
  background: none;
  font: 500 11px/1 var(--font-mono);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--c-muted-up);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-io);
}
.link:hover { color: var(--c-offwhite); }
.link:focus-visible { outline: 1px solid var(--c-light); outline-offset: 4px; }

/* ---------- Cruzes decorativas (padrão do site) ---------- */
.x { position: absolute; width: 9px; height: 9px; background: var(--cruz) no-repeat; pointer-events: none; }
.x.a { background-image: var(--cruz-acento); }
.x.tl { top: -34px; left: -40px; }
.x.tr { top: -34px; right: -40px; }
.x.bl { bottom: -34px; left: -40px; }
.x.br { bottom: -34px; right: -40px; }

/* ---------- Intro ---------- */
.intro { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.intro .lead { margin-inline: auto; }
.intro .actions { margin-top: 14px; }
.meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 18px;
  margin: 10px 0 0;
  font: 400 11px/1.6 var(--font-mono);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--c-muted-up);
}
.meta b { color: var(--c-offwhite); font-weight: 500; }
.meta i { width: 3px; height: 3px; border-radius: 50%; background: var(--c-muted-down); }

/* ---------- Pergunta ---------- */
.q-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.count {
  font: 400 11px/1.6 var(--font-mono);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--c-muted);
}
.count b { color: var(--c-offwhite); font-weight: 500; }

.hint {
  margin: 12px 0 0;
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--c-muted-up);
}

.opts { display: grid; gap: 10px; margin-top: 30px; }

.opt {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 60px;
  padding: 14px 18px;
  text-align: left;
  background: rgba(12, 7, 24, 0.55);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--c-offwhite);
  font-size: 1rem;
  line-height: 1.4;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--dur-fast) var(--ease-io),
              background var(--dur-fast) var(--ease-io),
              transform var(--dur-fast) var(--ease-io);
}
.opt .k {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font: 500 11px/1 var(--font-mono);
  color: var(--c-muted-up);
  transition: all var(--dur-fast) var(--ease-io);
}
.opt .t { flex: 1; }
.opt .go {
  flex: none;
  font-family: var(--font-mono);
  color: var(--c-light);
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--dur-normal) var(--ease-out);
}
.opt:focus-visible { outline: 2px solid var(--c-light); outline-offset: 2px; }
.opt:active { transform: scale(0.995); }
.opt.sel { border-color: var(--c-primary); background: rgba(112, 67, 221, 0.16); }
.opt.sel .k { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.opt.sel .go { opacity: 1; transform: none; }

@media (hover: hover) {
  .opt:hover { border-color: var(--border-accent); background: rgba(28, 18, 58, 0.6); }
  .opt:hover .k { border-color: var(--border-accent); color: var(--c-light); }
  .opt:hover .go { opacity: 1; transform: none; }
}

/* Campo "Outro" — abre sob as opções */
.other {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows var(--dur-normal) var(--ease-out),
              opacity var(--dur-normal) var(--ease-io),
              margin-top var(--dur-normal) var(--ease-out);
}
.other.open { grid-template-rows: 1fr; opacity: 1; margin-top: 10px; }
.other-in { position: relative; min-height: 0; overflow: hidden; }
.other input {
  width: 100%;
  height: 56px;
  padding: 0 60px 0 18px;
  background: rgba(12, 7, 24, 0.55);
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  color: var(--c-offwhite);
  font-size: 1rem; /* evita zoom no iOS */
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-io);
}
.other input::placeholder { color: var(--c-muted); }
.other input:focus { border-color: var(--c-primary); }
.other-go {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 4px;
  background: var(--c-primary);
  color: var(--c-offwhite);
  font-family: var(--font-mono);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-io), opacity var(--dur-fast) var(--ease-io);
}
.other-go:hover { background: var(--c-primary-hover); }
.other-go:focus-visible { outline: 2px solid var(--c-light); outline-offset: 2px; }
.other-go[disabled] { opacity: 0.3; cursor: default; }

.q-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  margin-top: 26px;
}
.kbd {
  font: 400 11px/1 var(--font-mono);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--c-muted-down);
}
@media (hover: none) { .kbd { display: none; } }

/* ---------- Contato ---------- */
.form { margin-top: 30px; }
.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block;
  margin-bottom: 8px;
  font: 500 11px/1.4 var(--font-mono);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--c-muted-up);
}
.field > span em { font-style: normal; color: var(--c-muted-down); }
.field input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  background: rgba(12, 7, 24, 0.6);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--c-offwhite);
  font-size: 1rem; /* evita zoom no iOS */
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-io), box-shadow var(--dur-fast) var(--ease-io);
}
.field input::placeholder { color: var(--c-muted-down); }
.field input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(112, 67, 221, 0.2); }
.form .q-foot { margin-top: 24px; }

/* ---------- Carregando ---------- */
.loading { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.ld-bar { position: relative; width: min(240px, 70vw); height: 1px; background: var(--border-strong); overflow: hidden; }
.ld-bar span {
  position: absolute;
  inset: 0;
  background: var(--c-light);
  transform-origin: left;
  animation: fill var(--ld, 1500ms) var(--ease-io) forwards;
}
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Resultado ---------- */
.result { display: flex; flex-direction: column; gap: 22px; }
.tag {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  background: rgba(112, 67, 221, 0.08);
  font: 500 11px/1 var(--font-mono);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--c-light);
}
.tag i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-light);
  box-shadow: 0 0 10px var(--c-light);
}

.steps { list-style: none; margin: 8px 0 6px; padding: 0; border-top: 1px solid var(--border); }
.steps li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.steps .n { padding-top: 4px; font: 500 11px/1.4 var(--font-mono); letter-spacing: var(--track-label); color: var(--c-light); }
.steps strong { display: block; font-size: 1.0625rem; font-weight: 500; letter-spacing: -0.015em; }
.steps p { margin: 2px 0 0; font-size: 0.9375rem; font-weight: 300; line-height: 1.6; color: var(--c-muted-up); }

.cta { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.note {
  margin: 0;
  font: 400 11px/1.6 var(--font-mono);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--c-muted);
}

/* ---------- Responsivo ---------- */
@media (max-width: 760px) {
  .x { display: none; }
}
@media (max-width: 520px) {
  .top { padding-top: 22px; }
  .logo { width: 92px; }
  .progress { margin-top: 20px; }
  .opt { min-height: 56px; padding: 12px 14px; gap: 14px; font-size: 0.975rem; }
  .btn { width: 100%; }
  .intro .actions { width: 100%; }
  .cta { align-items: stretch; }
  .form .q-foot { flex-direction: column-reverse; align-items: stretch; }
  .form .q-foot .link { align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}
