/* Arquétipo em Tecnologia e IA — @mdagnol.ia
   Direção de arte: Nova. Mood "Constelação Cognix" — petróleo profundo,
   luz que vem do alto, tipografia como drama, cor própria por arquétipo.
   Paleta Cognix360. PROIBIDO preto+laranja. Outfit (títulos) + Inter (texto). */

:root {
  /* Base Cognix360 (escura, cinematográfica) */
  --cx-ink: #071619;          /* fundo mais profundo */
  --cx-petrol: #0C2A30;       /* petróleo Cognix */
  --cx-petrol-2: #12363D;     /* petróleo elevado (cards) */
  --cx-petrol-line: #1E454C;  /* linhas sobre escuro */
  --cx-white: #FFFFFF;
  --cx-mist: #DCEAEA;         /* texto claro suave */
  --cx-muted: #7F9BA0;        /* texto secundário sobre escuro */
  --cx-teal: #68B5BF;
  --cx-teal-2: #4E8B93;
  --cx-teal-light: #A9D6DC;

  /* Cor do arquétipo — sobrescrita em runtime na tela de resultado.
     Default = teal Cognix. */
  --arq-accent: #68B5BF;
  --arq-accent-soft: #E4F2F3;
  --arq-deep: #0C2A30;
  --arq-halo: #164E58;

  --font-title: "Outfit", sans-serif;
  --font-text: "Inter", sans-serif;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;

  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.28);
  --shadow-glow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cx-ink);
  color: var(--cx-white);
  font-family: var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

h1, h2, h3, .title-font {
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

p { margin: 0; }
button { font-family: var(--font-text); cursor: pointer; }
a { color: var(--cx-teal-light); }
img { max-width: 100%; display: block; }

/* ---------------------------------------------------------------------- */
/* Shell / atmosfera de fundo                                             */
/* ---------------------------------------------------------------------- */

body::before {
  /* aura de luz global, fixa, dá profundidade à tela inteira */
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(104, 181, 191, 0.22), transparent 55%),
    radial-gradient(90% 60% at 90% 110%, rgba(42, 74, 79, 0.35), transparent 60%),
    linear-gradient(180deg, #0A2126 0%, #071619 60%, #050F11 100%);
  z-index: -2;
  pointer-events: none;
}

body::after {
  /* grão global sutil — mata o "flat de IA" */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 20px 22px calc(28px + env(safe-area-inset-bottom, 0px));
  animation: fadeSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.screen.active { display: flex; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 0;
}

.topbar__logo {
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: 700;
  color: var(--cx-white);
  letter-spacing: -0.01em;
}

.topbar__logo span { color: var(--cx-teal); }

/* ---------------------------------------------------------------------- */
/* Landing                                                                 */
/* ---------------------------------------------------------------------- */

.landing {
  justify-content: center;
  text-align: center;
  gap: 20px;
  flex: 1;
}

.landing__title + .landing__sub { margin-top: 4px; }

.landing__eyebrow {
  display: inline-flex;
  align-self: center;
  align-items: center;
  gap: 7px;
  background: rgba(104, 181, 191, 0.14);
  border: 1px solid rgba(104, 181, 191, 0.32);
  color: var(--cx-teal-light);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

/* orbe de luz no lugar do quadrado chapado antigo */
.landing__art {
  position: relative;
  margin: 4px auto 8px;
  width: 188px;
  height: 188px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, var(--cx-teal-light), var(--cx-teal) 42%, var(--cx-teal-2) 78%, #24545B 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 24px 60px rgba(104, 181, 191, 0.35),
    0 0 90px rgba(104, 181, 191, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: floaty 6s ease-in-out infinite;
}

.landing__art::before {
  /* halo pulsante ao redor do orbe */
  content: "";
  position: absolute;
  inset: -26px;
  border-radius: 50%;
  border: 1px solid rgba(104, 181, 191, 0.28);
  animation: pulseRing 3.2s ease-in-out infinite;
}

.landing__art::after {
  content: "";
  position: absolute;
  inset: -46px;
  border-radius: 50%;
  border: 1px solid rgba(104, 181, 191, 0.14);
  animation: pulseRing 3.2s ease-in-out infinite 0.5s;
}

.landing__art-icon {
  font-size: 74px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
  animation: floaty 5s ease-in-out infinite reverse;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.06); opacity: 0.25; }
}

.landing__title {
  font-size: 34px;
  line-height: 1.1;
  color: var(--cx-white);
  letter-spacing: -0.025em;
}

.landing__title em {
  font-style: normal;
  background: linear-gradient(120deg, var(--cx-teal-light), var(--cx-teal));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing__sub {
  font-size: 16px;
  line-height: 1.55;
  color: var(--cx-mist);
  max-width: 34ch;
  margin: 0 auto;
}

.landing__meta {
  font-size: 13px;
  color: var(--cx-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.landing__footer { padding-top: 6px; }

/* ---------------------------------------------------------------------- */
/* Botões                                                                  */
/* ---------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 17px 22px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-text);
  letter-spacing: 0.01em;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, filter 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--cx-teal-light) 0%, var(--cx-teal) 55%, var(--cx-teal-2) 100%);
  color: #06232A;
  box-shadow: 0 12px 30px rgba(104, 181, 191, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
  font-weight: 700;
}

.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 16px 40px rgba(104, 181, 191, 0.45); }

.btn-accent {
  background: linear-gradient(135deg, var(--arq-accent, var(--cx-teal)), color-mix(in srgb, var(--arq-accent, var(--cx-teal)) 70%, #2A4A4F));
  color: #06232A;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
  font-weight: 700;
}

.btn-accent:hover { filter: brightness(1.06); }

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  color: var(--cx-white);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
}

.btn-outline:hover { background: rgba(255, 255, 255, 0.08); }

.btn-whatsapp {
  background: #25D366;
  color: #06331B;
  font-weight: 700;
}

.btn-ghost {
  background: transparent;
  color: var(--cx-muted);
  font-weight: 500;
  padding: 10px;
}

.btn-ghost:hover { color: var(--cx-mist); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------------------------------------------------------------------- */
/* Quiz                                                                    */
/* ---------------------------------------------------------------------- */

.quiz__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
  margin-top: 4px;
}

.quiz__back {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  color: var(--cx-mist);
  font-size: 19px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.quiz__back:hover { background: rgba(255, 255, 255, 0.1); }

.quiz__progress-track {
  flex: 1;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.quiz__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cx-teal-2), var(--cx-teal) 60%, var(--cx-teal-light));
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0%;
  box-shadow: 0 0 12px rgba(104, 181, 191, 0.6);
}

.quiz__count {
  font-size: 13px;
  color: var(--cx-muted);
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.quiz__question {
  font-size: 27px;
  line-height: 1.22;
  margin-bottom: 28px;
  color: var(--cx-white);
  letter-spacing: -0.02em;
  font-weight: 600;
  animation: qIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes qIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.quiz__options {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 18px 17px;
  font-size: 15.5px;
  line-height: 1.4;
  color: var(--cx-mist);
  backdrop-filter: blur(4px);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
  animation: optIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.option-card:nth-child(1) { animation-delay: 0.04s; }
.option-card:nth-child(2) { animation-delay: 0.09s; }
.option-card:nth-child(3) { animation-delay: 0.14s; }
.option-card:nth-child(4) { animation-delay: 0.19s; }
.option-card:nth-child(5) { animation-delay: 0.24s; }
.option-card:nth-child(6) { animation-delay: 0.29s; }

@keyframes optIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (hover: hover) {
  .option-card:hover {
    border-color: rgba(104, 181, 191, 0.6);
    background: rgba(104, 181, 191, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  }
  .option-card:hover .option-card__badge {
    border-color: var(--cx-teal);
    color: var(--cx-white);
  }
}

.option-card:active { transform: scale(0.985); }

.option-card.is-selected {
  border-color: var(--cx-teal);
  background: linear-gradient(120deg, rgba(104, 181, 191, 0.22), rgba(104, 181, 191, 0.1));
  box-shadow: 0 0 0 1px var(--cx-teal), 0 12px 30px rgba(104, 181, 191, 0.28);
}

.option-card__badge {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--cx-muted);
  transition: all 0.18s ease;
}

.option-card.is-selected .option-card__badge {
  background: var(--cx-teal);
  border-color: var(--cx-teal);
  color: #06232A;
}

/* ---------------------------------------------------------------------- */
/* Captura                                                                 */
/* ---------------------------------------------------------------------- */

.capture__title {
  font-size: 28px;
  margin-bottom: 8px;
  margin-top: 8px;
  color: var(--cx-white);
  letter-spacing: -0.02em;
}

.capture__sub {
  font-size: 15px;
  color: var(--cx-mist);
  margin-bottom: 26px;
  line-height: 1.55;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cx-muted);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input[type="text"],
.field input[type="email"] {
  width: 100%;
  padding: 15px 17px;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  font-size: 16px;
  font-family: var(--font-text);
  background: rgba(255, 255, 255, 0.05);
  color: var(--cx-white);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.field input::placeholder { color: rgba(255, 255, 255, 0.32); }

.field input:focus {
  outline: none;
  border-color: var(--cx-teal);
  background: rgba(104, 181, 191, 0.08);
  box-shadow: 0 0 0 3px rgba(104, 181, 191, 0.22);
}

.field-error {
  color: #FF8A80;
  font-size: 13px;
  margin-top: 7px;
  display: none;
}

.field-error.is-visible { display: block; }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 22px 0 26px;
  cursor: pointer;
}

.consent input {
  margin-top: 3px;
  width: 19px;
  height: 19px;
  accent-color: var(--cx-teal);
  flex-shrink: 0;
}

.consent span {
  font-size: 13.5px;
  color: var(--cx-mist);
  line-height: 1.5;
}

/* ---------------------------------------------------------------------- */
/* Resultado — a revelação                                                 */
/* ---------------------------------------------------------------------- */

#screen-resultado {
  /* a tela inteira respira a cor do arquétipo */
  background:
    radial-gradient(100% 42% at 50% 0%, color-mix(in srgb, var(--arq-halo) 62%, transparent), transparent 70%);
}

.result__hero {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 40px 26px 36px;
  text-align: center;
  margin: 6px 0 26px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, color-mix(in srgb, var(--arq-halo) 90%, #000), var(--arq-deep) 70%);
  box-shadow: var(--shadow-glow), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  border: 1px solid color-mix(in srgb, var(--arq-accent) 40%, transparent);
}

.result__hero::before {
  /* holofote no topo do hero */
  content: "";
  position: absolute;
  top: -60%;
  left: 50%;
  width: 140%;
  height: 130%;
  transform: translateX(-50%);
  background: radial-gradient(circle, color-mix(in srgb, var(--arq-accent) 45%, transparent), transparent 60%);
  pointer-events: none;
  opacity: 0.9;
}

.result__hero > * { position: relative; }

.result__eyebrow {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--arq-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}

.result__name {
  font-size: 46px;
  line-height: 1.02;
  margin-bottom: 12px;
  color: var(--cx-white);
  letter-spacing: -0.03em;
  text-shadow: 0 6px 30px color-mix(in srgb, var(--arq-accent) 55%, transparent);
}

.result__apelido {
  font-size: 17px;
  font-weight: 600;
  color: var(--arq-accent);
  margin-bottom: 16px;
  font-family: var(--font-title);
  letter-spacing: 0.01em;
}

.result__tagline {
  font-size: 16px;
  font-weight: 400;
  color: var(--cx-mist);
  line-height: 1.5;
  max-width: 32ch;
  margin: 0 auto;
}

/* animação de revelação da conquista */
.result__hero.is-revealed .result__eyebrow { animation: revealUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.result__hero.is-revealed .result__name { animation: revealName 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both; }
.result__hero.is-revealed .result__apelido { animation: revealUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both; }
.result__hero.is-revealed .result__tagline { animation: revealUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.42s both; }

@keyframes revealName {
  from { opacity: 0; transform: translateY(18px) scale(0.94); filter: blur(6px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes revealUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.result__section {
  margin-bottom: 22px;
  padding: 18px 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
}

.result__section h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--arq-accent, var(--cx-teal));
  margin-bottom: 10px;
  font-weight: 700;
}

.result__section p {
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--cx-mist);
}

.result__section p + p { margin-top: 12px; }

.result__secundario {
  font-size: 14px;
  color: var(--cx-mist);
  padding: 14px 18px;
  border-left: 3px solid var(--arq-accent, var(--cx-teal));
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.result__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.result__actions-row { display: flex; gap: 12px; }
.result__actions-row .btn { flex: 1; }

.result__follow {
  margin-top: 30px;
  padding: 24px 22px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(104, 181, 191, 0.18), transparent 60%),
    linear-gradient(160deg, #0E2E34, #0A2126);
  border: 1px solid rgba(104, 181, 191, 0.22);
  color: var(--cx-white);
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.result__follow p {
  font-size: 14.5px;
  color: var(--cx-mist);
  margin-bottom: 16px;
  line-height: 1.55;
}

.result__restart {
  text-align: center;
  margin-top: 18px;
}

.card-preview {
  width: 100%;
  border-radius: var(--radius-md);
  margin: 18px 0;
  box-shadow: var(--shadow-glow);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: none;
  animation: revealUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-preview.is-visible { display: block; }

.result__loading {
  font-size: 13px;
  color: var(--cx-muted);
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(140%);
  background: rgba(14, 46, 52, 0.95);
  color: var(--cx-white);
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid rgba(104, 181, 191, 0.3);
  box-shadow: var(--shadow-glow);
  backdrop-filter: blur(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
  white-space: nowrap;
  max-width: 90vw;
}

.toast.is-visible { transform: translateX(-50%) translateY(0); }

/* ---------------------------------------------------------------------- */
/* Loading / erro                                                         */
/* ---------------------------------------------------------------------- */

.state-message {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 40px 24px;
  color: var(--cx-mist);
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--cx-teal);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* respeita quem prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (min-width: 540px) {
  #app {
    max-width: 480px;
    margin-top: 28px;
    margin-bottom: 28px;
    border-radius: 30px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    min-height: calc(100vh - 56px);
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.06);
  }
}
