:root {
  --fundo: #0a0a0f;
  --painel: rgba(255, 255, 255, 0.035);
  --painel-solido: #14141c;
  --borda: rgba(255, 255, 255, 0.09);
  --borda-forte: rgba(255, 255, 255, 0.16);
  --texto: #f2f3f7;
  --apagado: #8b90a0;
  --acento: #ff3d54;
  --acento-2: #ff8a3d;
  --ok: #34d399;
  --erro: #ff6b7d;
  --raio: 16px;
  --sombra: 0 18px 50px -12px rgba(0, 0, 0, 0.75);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  /* centraliza quando cabe na tela; "safe" evita cortar o topo quando nao cabe */
  display: grid;
  align-content: safe center;
  padding: clamp(24px, 6vw, 64px) clamp(16px, 5vw, 32px) 48px;
  padding-bottom: max(48px, env(safe-area-inset-bottom));
  background: var(--fundo);
  color: var(--texto);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* clarão de fundo, só decoração */
.brilho {
  position: fixed;
  inset: -30% 0 auto 50%;
  translate: -50% 0;
  width: min(1100px, 160vw);
  aspect-ratio: 1;
  background: radial-gradient(
    circle at center,
    rgba(255, 61, 84, 0.16),
    rgba(255, 138, 61, 0.07) 38%,
    transparent 66%
  );
  pointer-events: none;
  z-index: 0;
}

.folha {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vw, 22px);
}

/* ---------- topo ---------- */

.topo {
  text-align: center;
  margin-bottom: clamp(4px, 2vw, 12px);
}

.marca {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--borda);
  border-radius: 99px;
  background: var(--painel);
  margin-bottom: clamp(18px, 4vw, 26px);
}

.marca-icone {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--acento), var(--acento-2));
  color: #fff;
}

.marca-icone svg {
  width: 14px;
  height: 14px;
}

.marca-nome {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 8vw, 44px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.realce {
  background: linear-gradient(100deg, var(--acento), var(--acento-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub {
  margin: 14px 0 0;
  color: var(--apagado);
  font-size: clamp(14px, 3.6vw, 16px);
}

/* ---------- painéis ---------- */

.painel {
  background: var(--painel);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: clamp(16px, 4vw, 24px);
  backdrop-filter: blur(12px);
  box-shadow: var(--sombra);
  animation: subir 0.35s ease both;
}

@keyframes subir {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.campo + .campo,
.campo + .principal {
  margin-top: 16px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--apagado);
  margin-bottom: 8px;
}

.entrada {
  position: relative;
}

.entrada-icone {
  position: absolute;
  left: 14px;
  top: 50%;
  translate: 0 -50%;
  width: 18px;
  height: 18px;
  color: var(--apagado);
  pointer-events: none;
}

.entrada-icone svg {
  width: 100%;
  height: 100%;
}

input,
textarea,
select {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--borda);
  border-radius: 12px;
  color: var(--texto);
  padding: 14px 16px;
  font-size: 16px; /* 16px trava o zoom automático do iOS */
  font-family: inherit;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.entrada input,
.entrada select {
  padding-left: 42px;
}

select {
  appearance: none;
  cursor: pointer;
  /* seta desenhada em SVG: a nativa nao aceita cor no tema escuro */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b90a0' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 40px;
}

select option {
  background: var(--painel-solido);
  color: var(--texto);
}

input::placeholder,
textarea::placeholder {
  color: #5c6070;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--borda-forte);
  box-shadow: 0 0 0 3px rgba(255, 61, 84, 0.16);
}

/* ---------- botões ---------- */

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
}

.principal {
  width: 100%;
  margin-top: 18px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 22px;
  border-radius: 12px;
  background: linear-gradient(100deg, var(--acento), var(--acento-2));
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 26px -10px rgba(255, 61, 84, 0.7);
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}

.principal:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px -10px rgba(255, 61, 84, 0.8);
}

.principal:active:not(:disabled) {
  transform: translateY(0);
}

.principal:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.girando {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: girar 0.7s linear infinite;
}

.ocupado .girando {
  display: block;
}

@keyframes girar {
  to {
    rotate: 360deg;
  }
}

.secundario {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--borda);
  background: rgba(255, 255, 255, 0.05);
  color: var(--texto);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.16s, border-color 0.16s;
}

.secundario:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--borda-forte);
}

.secundario svg {
  width: 15px;
  height: 15px;
  flex: none;
}

/* ---------- avisos e etiquetas ---------- */

.rodape-painel {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.etiqueta {
  font-size: 13px;
  color: var(--apagado);
}

.etiqueta.acabou {
  color: var(--erro);
}

/* recado do campo de senha: vermelho quando erra, verde quando libera */
.recado {
  margin: 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--erro);
}

.recado.certo {
  color: var(--ok);
}

.tremendo {
  animation: tremer 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes tremer {
  20% {
    transform: translateX(-7px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(2px);
  }
}

.errado input {
  border-color: rgba(255, 107, 125, 0.6);
}

.aviso {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 107, 125, 0.1);
  border: 1px solid rgba(255, 107, 125, 0.3);
  color: var(--erro);
  font-size: 14px;
}

/* ---------- andamento ---------- */

.video {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.capa {
  position: relative;
  flex: none;
  width: 84px;
  aspect-ratio: 16 / 9;
  border-radius: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.capa img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.capa img.pronta {
  display: block;
}

.capa-vazia {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.12) 37%,
    rgba(255, 255, 255, 0.05) 63%
  );
  background-size: 300% 100%;
  animation: brilhar 1.4s ease infinite;
}

.capa img.pronta + .capa-vazia {
  display: none;
}

@keyframes brilhar {
  to {
    background-position: -300% 0;
  }
}

.video-texto {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.video-texto strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.barra {
  height: 6px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 99px;
  overflow: hidden;
}

.preenchimento {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--acento), var(--acento-2));
  transition: width 0.4s cubic-bezier(0.3, 0.8, 0.4, 1);
  position: relative;
  overflow: hidden;
}

.preenchimento::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.45),
    transparent
  );
  animation: correr 1.3s ease-in-out infinite;
}

@keyframes correr {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.linha-etapa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
}

.etapa {
  font-size: 14px;
  color: var(--texto);
}

/* ---------- resultado ---------- */

.cabecalho-resultado {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.cabecalho-resultado > div:first-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cabecalho-resultado strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.botoes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

textarea {
  min-height: min(52vh, 420px);
  resize: vertical;
  line-height: 1.75;
  font-size: 15px;
}

/* ---------- rodapé e torrada ---------- */

.rodape {
  text-align: center;
  font-size: 12px;
  color: #5c6070;
  margin-top: 4px;
}

.torrada {
  position: fixed;
  left: 50%;
  bottom: 26px;
  translate: -50% 0;
  padding: 11px 18px;
  border-radius: 99px;
  background: var(--painel-solido);
  border: 1px solid var(--borda-forte);
  box-shadow: var(--sombra);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  transform: translateY(10px);
  z-index: 10;
}

.torrada.aparecendo {
  opacity: 1;
  transform: translateY(0);
}

.escondido {
  display: none !important;
}

/* ---------- telas pequenas ---------- */

@media (max-width: 480px) {
  .capa {
    width: 68px;
  }

  .botoes {
    width: 100%;
  }

  .secundario {
    flex: 1;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
