:root {
  --roxo: #7420c3;
  --magenta: #e11896;
  --laranja: #ffaf1a;
  --ink: #14072b;
  --texto: #3a3346;
  --suave: #f7f4fb;
  --linha: #e9e1f2;
  --branco: #ffffff;
  --fundo: #fbf9fd;
  --erro: #c62828;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--texto);
  background: var(--fundo);
  line-height: 1.5;
}

.topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 16px;
}
.marca { font-weight: 800; font-size: 22px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.logo {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--roxo), var(--magenta));
  color: var(--branco); font-size: 15px;
}
.selo { font-size: 14px; background: var(--suave); border: 1px solid var(--linha); padding: 6px 12px; border-radius: 99px; }

main { max-width: 980px; margin: 0 auto; padding: 0 16px 48px; }

.intro { text-align: center; padding: 24px 0 28px; }
.intro h1 { font-size: clamp(30px, 6vw, 48px); line-height: 1.1; color: var(--ink); margin: 0 0 12px; font-weight: 800; }
.intro p { font-size: 18px; margin: 0 auto; max-width: 560px; }
.destaque { background: linear-gradient(90deg, var(--roxo), var(--magenta)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.cartao {
  background: var(--branco);
  border: 1px solid var(--linha);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(116, 32, 195, .08);
}

.zona {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 2px dashed #cdb8e6; border-radius: 16px;
  padding: 36px 16px; text-align: center; cursor: pointer;
  background: var(--suave); transition: border-color .15s, background .15s;
}
.zona:hover, .zona:focus-visible, .zona.por-cima { border-color: var(--roxo); background: #f1e8fb; outline: none; }
.zona-icone { font-size: 40px; }
.zona strong { font-size: 19px; color: var(--ink); }

.lista { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.lista li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: 1px solid var(--linha); border-radius: 12px;
}
.lista .nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }
.lista .info { font-size: 14px; color: #7b7389; white-space: nowrap; }
.lista button { border: 0; background: none; font-size: 18px; cursor: pointer; color: #7b7389; padding: 0 4px; }

.opcoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 22px 0; }
.campo { display: flex; flex-direction: column; gap: 8px; }
.rotulo { font-weight: 600; color: var(--ink); font-size: 15px; }
.rotulo output { color: var(--roxo); }

.botoes { display: flex; gap: 6px; }
.botoes label { flex: 1; }
.botoes input { position: absolute; opacity: 0; pointer-events: none; }
.botoes span {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 44px; padding: 6px 8px; border: 1px solid var(--linha); border-radius: 10px;
  cursor: pointer; font-weight: 600; text-align: center; line-height: 1.2;
}
.botoes small { font-weight: 400; font-size: 12px; color: #7b7389; }
.botoes input:checked + span { border-color: var(--roxo); background: #f1e8fb; color: var(--roxo); }
.botoes input:focus-visible + span { outline: 2px solid var(--roxo); outline-offset: 2px; }

input[type="text"] {
  font: inherit; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--linha); border-radius: 10px; width: 100%;
}
input[type="text"]:focus { outline: 2px solid var(--roxo); outline-offset: 1px; }
input[type="range"] { accent-color: var(--roxo); min-height: 44px; }

.principal {
  font: inherit; font-weight: 700; font-size: 17px;
  border: 0; border-radius: 12px; padding: 14px 26px; cursor: pointer;
  background: linear-gradient(135deg, var(--roxo), var(--magenta)); color: var(--branco);
}
.cartao > .principal { width: 100%; }
.principal:disabled { opacity: .45; cursor: not-allowed; }
.principal:not(:disabled):hover { filter: brightness(1.08); }

.progresso { margin-top: 16px; display: grid; gap: 6px; font-size: 14px; }
.barra { height: 8px; background: var(--suave); border-radius: 99px; overflow: hidden; }
.barra div { height: 100%; width: 0; background: linear-gradient(90deg, var(--roxo), var(--magenta)); transition: width .2s; }

.erro { color: var(--erro); font-weight: 600; margin: 14px 0 0; }

.resultado { margin-top: 32px; }
.resultado-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.resultado-topo h2 { margin: 0; color: var(--ink); font-size: 22px; }

.grelha { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.pagina {
  background: var(--branco); border: 1px solid var(--linha); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column;
}
.pagina .miniatura { aspect-ratio: 3 / 4; display: grid; place-items: center; background: var(--suave); padding: 10px; }
.pagina img { max-width: 100%; max-height: 100%; box-shadow: 0 2px 8px rgba(0,0,0,.12); background: #fff; }
.pagina .legenda { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.pagina .legenda span { color: #7b7389; white-space: nowrap; }
.pagina a {
  font-weight: 700; color: var(--roxo); text-decoration: none;
  border: 1px solid var(--linha); border-radius: 8px; padding: 6px 10px;
}
.pagina a:hover { background: #f1e8fb; }

.rodape { text-align: center; font-size: 14px; color: #7b7389; padding: 24px 16px 32px; }

@media (max-width: 520px) {
  .cartao { padding: 16px; }
  .grelha { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .resultado-topo .principal { width: 100%; }
}
