/* ─── QUAD — Diagnóstico do Investidor M4D ───
   Design tokens alinhados com wealth_v0.2/index.html
*/

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

:root {
  --bg:         #0a0a0b;
  --bg-2:       #0e0e11;
  --card:       #121217;
  --surface:    #17171d;
  --surface-2:  #1c1c23;
  --red:        #D52B34;
  --red-dark:   #A1242A;
  --red-glow:   rgba(213, 43, 52, 0.18);
  --red-faint:  rgba(213, 43, 52, 0.05);
  --steel:      #293541;
  --steel-2:    #354859;
  --text:       #ffffff;
  --text-2:     rgba(255, 255, 255, 0.68);
  --text-3:     rgba(255, 255, 255, 0.42);
  --text-4:     rgba(255, 255, 255, 0.22);
  --hairline:   rgba(255, 255, 255, 0.07);
  --hairline-2: rgba(255, 255, 255, 0.12);
  --red-line:   rgba(213, 43, 52, 0.30);

  --display:    'Mona Sans', ui-sans-serif, system-ui, sans-serif;
  --body:       'Inter', ui-sans-serif, system-ui, sans-serif;
  --mono:       'Fragment Mono', ui-monospace, monospace;

  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2000;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font-family: inherit; }
::selection { background: var(--red); color: #fff; }

.accent { color: var(--red); }

/* ─── TOP BAR ─── */
.topbar {
  height: 60px;
  padding: 0 24px;
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}
.topbar-brand img { width: 22px; height: auto; }
.topbar-brand-accent { color: var(--text-3); font-weight: 500; }

.topbar-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.topbar-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

/* ─── BADGE (chip) ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border: 1px solid var(--red-line);
  background: var(--red-faint);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 17px 30px;
  border: 1px solid var(--red);
  border-radius: 2px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.3s var(--ease);
  cursor: pointer;
  text-decoration: none;
}
.btn-primary {
  background: var(--red);
  color: #fff;
}
.btn-primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  box-shadow: 0 14px 34px -14px rgba(213,43,52,0.55);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--surface);
  border-color: var(--hairline-2);
  color: var(--text-3);
  box-shadow: none;
}
.btn .arrow {
  width: 16px; height: 10px;
  position: relative;
  transition: transform 0.3s var(--ease);
}
.btn .arrow::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 100%; height: 1.5px;
  background: currentColor;
  transform: translateY(-50%);
}
.btn .arrow::after {
  content: '';
  position: absolute;
  right: 0; top: 50%;
  width: 7px; height: 7px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}
.btn:hover:not(:disabled) .arrow { transform: translateX(5px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--hairline-2);
  border-radius: 2px;
  font-family: var(--body);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.25s var(--ease);
  cursor: pointer;
}
.btn-ghost:hover {
  border-color: var(--text-2);
  background: var(--surface);
  color: var(--text);
}
.btn-back::before {
  content: '←';
  display: inline-block;
  transition: transform 0.25s var(--ease);
}
.btn-back:hover::before { transform: translateX(-3px); }

/* ═════════════════════════════════════════
   PÁGINA 1 — INÍCIO
   ═════════════════════════════════════════ */
.start {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 24px 72px;
  position: relative;
  overflow: hidden;
}
.start::before {
  content: '';
  position: absolute;
  top: -10%; left: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--red-glow), transparent 65%);
  filter: blur(30px);
  pointer-events: none;
  z-index: 0;
}
.start::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.4;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 30%, transparent 75%);
  pointer-events: none;
}
.start-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  width: 100%;
  text-align: left;
}
.start-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(44px, 9vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.028em;
  margin: 22px 0 24px;
  color: var(--text);
}
.start-sub {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--text-2);
  margin-bottom: 36px;
  max-width: 560px;
}
.start-bullets {
  list-style: none;
  margin-bottom: 44px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.start-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}
.start-bullets svg {
  flex-shrink: 0;
  width: 20px; height: 20px;
  color: var(--red);
  margin-top: 1px;
}

.start-proof {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.proof-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.proof-num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--red);
  line-height: 1;
}
.proof-lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.proof-divider {
  width: 1px;
  height: 26px;
  background: var(--hairline-2);
}

/* ═════════════════════════════════════════
   PÁGINA 2 — PERGUNTAS
   ═════════════════════════════════════════ */
.quiz {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 32px 20px 60px;
  position: relative;
}
.quiz-inner {
  width: 100%;
  max-width: 640px;
}

/* Header: progress + meta */
.quiz-head {
  margin-bottom: 36px;
}
.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}
.quiz-meta .current {
  color: var(--text);
  font-weight: 500;
}
.quiz-bar {
  position: relative;
  height: 3px;
  background: var(--hairline);
  border-radius: 2px;
  overflow: hidden;
}
.quiz-bar-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: var(--red);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--red-glow);
  transition: width 0.45s var(--ease);
  width: 0%;
}

/* Question */
.quiz-category {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--hairline-2);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 18px;
}
.quiz-question {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 5.2vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 28px;
}

/* Options */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}
.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--body);
  font-size: 14.5px;
  line-height: 1.45;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  position: relative;
}
.quiz-option:hover {
  background: var(--surface);
  border-color: var(--hairline-2);
  transform: translateX(3px);
}
.quiz-option.selected {
  background: rgba(213, 43, 52, 0.08);
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red);
}
.quiz-option.selected::before {
  content: '';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
}

/* Nav footer */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  gap: 14px;
}
.quiz-nav .btn-primary { padding: 15px 26px; font-size: 12px; }
.quiz-nav-spacer { flex: 1; }

/* ═════════════════════════════════════════
   PÁGINA 3 — RESULTADO + GATE
   ═════════════════════════════════════════ */
.result {
  flex: 1;
  padding: 40px 20px 60px;
  display: flex;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.result::before {
  content: '';
  position: absolute;
  top: 0; right: -15%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--red-glow), transparent 65%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}
.result-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
}

/* Capa do arquétipo (visível, preview) */
.archetype-card {
  background: linear-gradient(180deg, rgba(213,43,52,0.05) 0%, transparent 50%), var(--card);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 44px 32px 36px;
  position: relative;
  margin-bottom: 28px;
}
.archetype-card::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 44px; height: 44px;
  border-top: 2px solid var(--red);
  border-left: 2px solid var(--red);
  border-top-left-radius: 4px;
}
.archetype-card::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 44px; height: 44px;
  border-bottom: 2px solid var(--red);
  border-right: 2px solid var(--red);
  border-bottom-right-radius: 4px;
}
.archetype-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}
.archetype-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(34px, 7vw, 44px);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--red);
  margin-bottom: 14px;
}
.archetype-rarity {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--text-2);
  margin-bottom: 24px;
}
.archetype-tagline {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 20px;
  line-height: 1.35;
  color: var(--text);
  padding: 20px 0;
  border-top: 1px solid var(--hairline);
  margin-bottom: 22px;
}
.archetype-mirror {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-2);
}

/* Gate (form) */
.gate {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 32px 28px;
  position: relative;
}
.gate-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--red-faint);
  border: 1px solid var(--red-line);
  color: var(--red);
  margin-bottom: 16px;
}
.gate-lock svg { width: 18px; height: 18px; }

.gate-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}
.gate-sub {
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 22px;
}
.gate-list {
  list-style: none;
  margin-bottom: 26px;
  padding: 20px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gate-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.45;
}
.gate-list svg {
  flex-shrink: 0;
  width: 16px; height: 16px;
  color: var(--red);
  margin-top: 2px;
}

/* Form */
.form-group {
  margin-bottom: 14px;
}
.form-label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 7px;
}
.form-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--hairline-2);
  border-radius: 2px;
  color: var(--text);
  font-size: 15px;
  font-family: var(--body);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.form-input:focus {
  outline: none;
  border-color: var(--red);
  background: var(--surface);
}
.form-input::placeholder { color: var(--text-4); }

.gate .btn-primary {
  width: 100%;
  margin-top: 10px;
}

.gate-privacy {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: center;
}

/* ─── FOOTER ─── */
.footer-mini {
  text-align: center;
  padding: 24px 20px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-4);
  border-top: 1px solid var(--hairline);
}

/* ═════════════════════════════════════════
   RESPONSIVE
   ═════════════════════════════════════════ */
@media (min-width: 720px) {
  .topbar { padding: 0 44px; height: 66px; }
  .start { padding: 80px 44px 96px; }
  .start-title { font-size: clamp(56px, 7vw, 84px); }
  .quiz { padding: 48px 44px 80px; }
  .result { padding: 56px 44px 80px; }
  .archetype-card { padding: 52px 44px 44px; }
  .gate { padding: 40px 40px; }
}

/* Animações de entrada */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.start-inner > * {
  animation: fadeUp 0.7s var(--ease) both;
}
.start-inner > *:nth-child(1) { animation-delay: 0.05s; }
.start-inner > *:nth-child(2) { animation-delay: 0.15s; }
.start-inner > *:nth-child(3) { animation-delay: 0.25s; }
.start-inner > *:nth-child(4) { animation-delay: 0.35s; }
.start-inner > *:nth-child(5) { animation-delay: 0.45s; }
.start-inner > *:nth-child(6) { animation-delay: 0.55s; }

.quiz-inner > * { animation: fadeUp 0.5s var(--ease) both; }
.quiz-inner > *:nth-child(1) { animation-delay: 0.05s; }
.quiz-inner > *:nth-child(2) { animation-delay: 0.12s; }

.result-inner > * { animation: fadeUp 0.6s var(--ease) both; }
.result-inner > *:nth-child(1) { animation-delay: 0.05s; }
.result-inner > *:nth-child(2) { animation-delay: 0.25s; }
