/* Candidatura: escuro premium, um ecrã de cada vez. */
:root {
  --bg: #0b0907;
  --ink: #f6f1ec;
  --soft: #b3a79b;
  --line: rgba(246, 241, 236, 0.12);
  --gold: #c9a063;
  --accent: #e0345b;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
* {
  box-sizing: border-box;
  margin: 0;
}
html,
body {
  min-height: 100%;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
}
.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      700px 420px at 50% 0%,
      rgba(201, 160, 99, 0.22),
      transparent 70%
    ),
    radial-gradient(
      500px 360px at 85% 100%,
      rgba(224, 52, 91, 0.14),
      transparent 70%
    );
}

.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 760;
  letter-spacing: -0.03em;
}
.brand img {
  border-radius: 8px;
}
.prog {
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  max-width: 420px;
  justify-self: center;
  width: 100%;
}
.prog i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold), #f3d9a4);
  transition: width 0.7s var(--ease);
}
.snd {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.snd[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}

.scr {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 90px 22px 40px;
  gap: 20px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px);
  transition:
    opacity 0.6s var(--ease),
    transform 0.7s var(--ease);
  overflow-y: auto;
}
.scr.on {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.scr.out {
  opacity: 0;
  transform: translateY(-24px);
}
.kick {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 650;
}
h1,
h2 {
  font-weight: 780;
  letter-spacing: -0.045em;
  line-height: 1.05;
  max-width: 16ch;
}
h1 {
  font-size: clamp(38px, 6vw, 72px);
}
h2 {
  font-size: clamp(30px, 4.4vw, 52px);
  max-width: 20ch;
}
.l2,
.react {
  font-size: 18px;
  line-height: 1.55;
  color: var(--soft);
  max-width: 40ch;
}
.l4 {
  font-size: 13px;
  color: var(--soft);
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: 58px;
  padding: 0 8px 0 28px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: linear-gradient(180deg, #fbf8f5, #e9e0d6);
  color: #16120e;
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
  box-shadow: 0 18px 40px -16px rgba(201, 160, 99, 0.6);
  transition:
    transform 0.3s var(--ease),
    opacity 0.3s;
}
.cta .arr {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(22, 18, 14, 0.08);
}
.cta:active {
  transform: scale(0.97);
}
.cta:disabled {
  opacity: 0.25;
  cursor: default;
}
.cta:focus-visible,
.opts button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* cartão 3D */
.intro {
  perspective: 1200px;
}
.card3d {
  position: relative;
  width: min(420px, 82vw);
  border-radius: 22px;
  overflow: hidden;
  transform-style: preserve-3d;
  filter: drop-shadow(0 50px 60px rgba(0, 0, 0, 0.7));
}
.card3d img {
  width: 100%;
  display: block;
}
.sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 240, 210, 0.45) 48%,
    transparent 62%
  );
  transform: translateX(-120%);
}

/* opções */
.opts {
  display: grid;
  gap: 12px;
  width: min(520px, 100%);
}
.opts button {
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.2s var(--ease);
}
.opts button:hover {
  background: rgba(255, 255, 255, 0.08);
}
.opts button.sel {
  border-color: var(--gold);
  background: rgba(201, 160, 99, 0.14);
  transform: scale(1.02);
}
.react {
  min-height: 56px;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.5s var(--ease),
    transform 0.5s var(--ease);
  color: #efe4d6;
}
.react.on {
  opacity: 1;
  transform: none;
}

/* desejo */
.want {
  font-size: clamp(64px, 12vw, 120px);
  font-weight: 800;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff6e4, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: min(520px, 100%);
  height: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold);
  border: 4px solid #fff6e4;
  cursor: grab;
  box-shadow: 0 0 0 8px rgba(201, 160, 99, 0.18);
}
input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  border: 4px solid #fff6e4;
}

/* campos */
form label {
  display: grid;
  gap: 8px;
  width: min(520px, 100%);
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--soft);
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: min(520px, 100%);
}
.two label {
  width: auto;
}
form input,
form select {
  height: 56px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  padding: 0 18px;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
}
form select option {
  color: #16120e;
}
form input:focus,
form select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
}
.err {
  min-height: 22px;
  color: #ff8a9f;
  font-size: 14px;
}

/* final */
.checks {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 14px;
  font-size: 20px;
  font-weight: 600;
  text-align: left;
}
.checks li {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0.25;
  transition: opacity 0.4s;
}
.checks li::before {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--line);
  flex: none;
  transition: all 0.4s var(--ease);
}
.checks li.ok {
  opacity: 1;
}
.checks li.ok::before {
  border-color: var(--gold);
  background: var(--gold) no-repeat center / 14px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='%2316120e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.checks li.run {
  opacity: 1;
}
.checks li.run::before {
  border-color: var(--gold);
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.reveal {
  display: grid;
  justify-items: center;
  gap: 18px;
}
.namecard {
  position: relative;
  width: min(400px, 82vw);
  border-radius: 20px;
  overflow: hidden;
  filter: drop-shadow(0 40px 50px rgba(0, 0, 0, 0.7));
}
.namecard img {
  width: 100%;
  display: block;
}
.namecard b {
  position: absolute;
  left: 8%;
  bottom: 16%;
  font-size: clamp(16px, 3vw, 22px);
  letter-spacing: 0.18em;
  color: #e8cf9c;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}
.namecard small {
  position: absolute;
  left: 8%;
  bottom: 8%;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #bfa575;
}
.next {
  text-align: left;
  display: grid;
  gap: 10px;
  max-width: 460px;
  padding-left: 22px;
  color: var(--soft);
  line-height: 1.5;
}
.next b {
  color: var(--ink);
}
.back {
  font-size: 14px;
  color: var(--soft);
  text-decoration: underline;
}
#fallback .cta {
  margin-top: 4px;
}
.coin {
  position: fixed;
  z-index: 100;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #e2b457 45%, #a8772c);
}

@media (prefers-reduced-motion: no-preference) {
  .intro.on .card3d {
    animation: cardin 2s var(--ease) both;
  }
  .intro.on .sheen {
    animation: sheen 1.6s 1.2s ease-in-out both;
  }
  .intro.on .l1 {
    animation: fade 0.9s 1.6s var(--ease) both;
  }
  .intro.on .l2 {
    animation: fade 0.9s 2.4s var(--ease) both;
  }
  .intro.on .l3 {
    animation: fade 0.9s 3.2s var(--ease) both;
  }
  .intro.on .l4 {
    animation: fade 0.9s 3.5s var(--ease) both;
  }
  @keyframes cardin {
    from {
      opacity: 0;
      transform: rotateY(-70deg) rotateX(20deg) translateZ(-200px) scale(0.7);
      filter: blur(12px);
    }
    60% {
      opacity: 1;
      filter: blur(0);
    }
  }
  @keyframes sheen {
    to {
      transform: translateX(120%);
    }
  }
  @keyframes fade {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
  }
  .reveal:not([hidden]) .namecard {
    animation: flip 1.1s var(--ease) both;
  }
  .reveal:not([hidden]) > :not(.namecard) {
    animation: fade 0.7s var(--ease) both;
  }
  .reveal:not([hidden]) > :nth-child(2) {
    animation-delay: 0.6s;
  }
  .reveal:not([hidden]) > :nth-child(3) {
    animation-delay: 0.85s;
  }
  .reveal:not([hidden]) > :nth-child(4) {
    animation-delay: 1.1s;
  }
  .reveal:not([hidden]) > :nth-child(5) {
    animation-delay: 1.3s;
  }
  .reveal:not([hidden]) > :nth-child(6) {
    animation-delay: 1.5s;
  }
  @keyframes flip {
    from {
      opacity: 0;
      transform: perspective(1000px) rotateY(180deg) scale(0.8);
    }
  }
}
@media (max-width: 560px) {
  .two {
    grid-template-columns: 1fr;
  }
  .top {
    padding: 14px 16px;
    gap: 14px;
  }
  .brand {
    font-size: 0;
    gap: 0;
  }
  .scr {
    justify-content: flex-start;
    padding-top: 96px;
  }
  .intro {
    justify-content: center;
  }
}

/* v2: sem cortes. Cada ecrã ocupa a altura do ecrã e cresce se precisar. */
main#flow { position: relative; min-height: 100dvh; }
.scr { position: absolute; inset: 0 0 auto 0; min-height: 100dvh; justify-content: safe center; overflow: visible; padding-bottom: 60px; }
.scr:not(.on) { height: 100dvh; overflow: hidden; }
.scr.on { position: relative; }
@media (max-width: 560px) { .scr { justify-content: flex-start; padding-top: 88px; } .intro { justify-content: center; } h2 { font-size: 30px; } }

/* v3 */
.card3d { width: min(360px, 70vw, 42vh); border-radius: 0; overflow: visible; }
.card3d .sheen { border-radius: 5%; -webkit-mask: url(/assets/cards/black.webp) center / 100% 100%; mask: url(/assets/cards/black.webp) center / 100% 100%; }
.intro { gap: 16px; }
.intro h1 { font-size: clamp(34px, 5vw, 60px); }
.namecard { width: min(340px, 72vw, 36vh); overflow: visible; border-radius: 0; }
.final { gap: 14px; }
.final h2 { font-size: clamp(28px, 4vw, 46px); }
.react.small { font-size: 16px; min-height: 0; }
#fallback { display: grid; justify-items: center; gap: 10px; }
.alt { font-size: 13px; color: var(--soft); text-decoration: underline; }
h2.typing::after { content: ""; display: inline-block; width: 3px; height: 0.9em; margin-left: 4px; background: var(--gold); vertical-align: -0.1em; animation: blink 0.6s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
body.flash::after { content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; background: radial-gradient(circle at 50% 40%, rgba(255, 226, 160, 0.55), transparent 60%); animation: flash 0.9s ease-out forwards; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) { .reveal:not([hidden]) .namecard { animation: flip 1.1s var(--ease) both, glowin 2.4s 1s ease-in-out infinite; } @keyframes glowin { 50% { filter: drop-shadow(0 40px 50px rgba(0,0,0,.7)) drop-shadow(0 0 30px rgba(201,160,99,.55)); } } }
.card3d .sheen { display: none; }
form textarea { border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.05); padding: 14px 18px; font: inherit; font-size: 17px; color: var(--ink); resize: none; }
form textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.meter { width: min(520px, 100%); height: 6px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; transition: width .4s var(--ease), background .3s; }

/* v4: cartões com proporção certa, botões sempre visíveis, final compacto */
img { height: auto; }
.card3d, .namecard { aspect-ratio: auto; }
.card3d img, .namecard img { width: 100%; height: auto !important; }
.scr { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
.final .reveal { gap: 10px; max-width: 520px; }
.final .react.small { margin-top: 4px; }
.final #fallback { margin-top: 14px; }
.final .back { margin-top: 18px; display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); }
