:root {
  --fundo: #000;
  --superficie: #0c0d0e;
  --campo: #17181a;
  --borda: #26282c;
  --borda-foco: #3a3d42;
  --texto: #fff;
  --texto-2: #a3a7ae;
  --texto-3: #6b6f76;
  --verde: #10c76b;
  --verde-escuro: #0aa457;
  --verde-texto: #22d47c;
  --vermelho: #ff5a5f;
  --amarelo: #f5b83d;
  --raio: 14px;
  --fonte: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--fonte);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.travado { overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; text-decoration: none;
  transition: background .15s, border-color .15s, transform .1s;
  user-select: none;
}
.btn:active { transform: scale(.98); }
.btn-primario { background: var(--verde); color: #04140b; }
.btn-primario:hover { background: #14d677; }
.btn-primario:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: #121315; border-color: var(--borda); color: var(--texto); }
.btn-ghost:hover { border-color: var(--borda-foco); }
.btn-grande { height: 52px; padding: 0 26px; font-size: 15px; border-radius: 12px; }
.btn-bloco { width: 100%; height: 50px; font-size: 15px; border-radius: 12px; margin-top: 6px; }

.link {
  background: none; border: 0; padding: 0;
  color: var(--verde-texto); font-weight: 600; text-decoration: none;
}
.link:hover { text-decoration: underline; }

/* ---------- Topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; padding-top: max(14px, env(safe-area-inset-top));
  background: rgba(0,0,0,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid #111214;
}
.logo {
  font-weight: 900; font-size: 24px; letter-spacing: -.5px;
  color: var(--texto); text-decoration: none;
}
.logo span, .banner-logo span { color: var(--verde); }
.topo-acoes { display: flex; align-items: center; gap: 8px; }
.usuario-email {
  color: var(--texto-2); font-size: 13px;
  max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- Início (fundo) ---------- */
.inicio { padding: 0 20px; }
.hero {
  max-width: 640px; margin: 0 auto;
  min-height: calc(100dvh - 72px);
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px 0;
}
.hero-selo {
  align-self: flex-start; margin: 0 0 18px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(16,199,107,.12); color: var(--verde-texto);
  font-size: 12px; font-weight: 600; letter-spacing: .3px;
}
.hero h1 {
  margin: 0; font-size: clamp(32px, 7vw, 54px); line-height: 1.08;
  font-weight: 800; letter-spacing: -1px; text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--verde); }
.hero-texto { color: var(--texto-2); font-size: 17px; margin: 16px 0 32px; }
.hero-botoes { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Pop-up (modal) ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 20px;
}
.modal-fundo {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.72); backdrop-filter: blur(6px);
  animation: aparecer .2s ease-out;
}
.modal-caixa {
  position: relative;
  display: grid; grid-template-columns: 290px 1fr; gap: 0;
  width: min(690px, 100%); max-height: calc(100dvh - 40px);
  background: var(--superficie);
  border: 1px solid #1d1f22; border-radius: 24px;
  padding: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.7);
  animation: subir .25s cubic-bezier(.2,.9,.3,1.1);
}

/* Banner lateral (arte da marca, feita só com CSS) */
.modal-banner {
  position: relative; overflow: hidden;
  border-radius: 16px; min-height: 500px;
  background:
    radial-gradient(120% 70% at 50% 45%, rgba(16,199,107,.55), transparent 60%),
    radial-gradient(80% 40% at 50% 100%, rgba(16,199,107,.35), transparent 70%),
    linear-gradient(160deg, #06301b 0%, #03140b 55%, #000 100%);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 26px 22px;
}
.banner-logo {
  position: relative; z-index: 1;
  font-weight: 900; font-size: 42px; letter-spacing: -1px; text-align: center;
  text-shadow: 0 4px 20px rgba(0,0,0,.6);
}
.banner-brilho {
  position: absolute; left: 50%; top: 48%;
  width: 230px; height: 230px; transform: translate(-50%,-50%);
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.07) 0 8deg, transparent 8deg 20deg);
  mask: radial-gradient(circle, #000 30%, transparent 70%);
  animation: girar 30s linear infinite;
}
.banner-brilho::after {
  content: ""; position: absolute; inset: 70px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7dffb9, var(--verde) 45%, #05542c);
  box-shadow: 0 0 60px rgba(16,199,107,.8);
}
.banner-texto {
  position: relative; z-index: 1; text-align: center;
  font-weight: 900; text-transform: uppercase; font-style: italic; line-height: 1;
}
.banner-texto strong { display: block; font-size: 34px; letter-spacing: -.5px; }
.banner-texto span { display: block; font-size: 22px; color: var(--verde-texto); margin-top: 6px; }

.modal-corpo {
  position: relative;
  padding: 10px 18px 6px 30px;
  overflow-y: auto; overscroll-behavior: contain;
}
.modal-corpo-centro { display: flex; flex-direction: column; justify-content: center; }
.modal-corpo h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.modal-sub { margin: 2px 0 22px; color: var(--texto-2); font-size: 13px; }
.modal-fechar {
  position: absolute; top: 0; right: 0;
  width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: #1b1c1f; color: var(--texto);
  display: grid; place-items: center;
}
.modal-fechar:hover { background: #26282c; }
.modal-fechar svg { width: 16px; height: 16px; }

/* ---------- Campos ---------- */
.campo { display: block; margin-bottom: 16px; }
.campo-rotulo { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.campo-caixa {
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 14px;
  background: var(--campo); border: 1px solid var(--borda); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.campo-caixa:focus-within { border-color: var(--verde); box-shadow: 0 0 0 3px rgba(16,199,107,.15); }
.campo-caixa.invalido { border-color: var(--vermelho); box-shadow: 0 0 0 3px rgba(255,90,95,.12); }
.campo-icone { width: 18px; height: 18px; color: var(--texto-3); flex: none; }
.campo-caixa input {
  flex: 1; min-width: 0; height: 100%;
  background: none; border: 0; outline: 0;
  font-size: 16px; /* evita zoom no iPhone */
}
.campo-caixa input::placeholder { color: var(--texto-3); }
.ver-senha {
  flex: none; width: 30px; height: 30px; margin-right: -6px;
  display: grid; place-items: center;
  background: none; border: 0; color: var(--texto-2); border-radius: 8px;
}
.ver-senha:hover { color: var(--texto); }
.ver-senha svg { width: 18px; height: 18px; }

/* Força da senha */
.forca { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: -6px 0 8px; }
.forca i { height: 4px; border-radius: 4px; background: #2a2c30; transition: background .2s; }
.forca[data-nivel="1"] i:nth-child(-n+1) { background: var(--vermelho); }
.forca[data-nivel="2"] i:nth-child(-n+2) { background: var(--amarelo); }
.forca[data-nivel="3"] i:nth-child(-n+3) { background: #9bd84a; }
.forca[data-nivel="4"] i:nth-child(-n+4) { background: var(--verde); }
.dica { margin: 0 0 14px; font-size: 11.5px; color: var(--texto-2); }

#btnCupom { font-size: 13px; margin-bottom: 16px; }
#campoCupom { margin-top: -6px; }

/* Aceite (checkbox) */
.aceite {
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 12.5px; color: var(--texto-2); margin-bottom: 18px; cursor: pointer;
}
.aceite input { position: absolute; opacity: 0; pointer-events: none; }
.aceite-caixa {
  flex: none; width: 20px; height: 20px; margin-top: 1px;
  border: 1.5px solid #4a4d53; border-radius: 5px;
  display: grid; place-items: center; transition: all .15s;
}
.aceite input:checked + .aceite-caixa { background: var(--verde); border-color: var(--verde); }
.aceite input:checked + .aceite-caixa::after {
  content: ""; width: 10px; height: 6px;
  border: solid #04140b; border-width: 0 0 2px 2px;
  transform: rotate(-45deg) translate(1px, -1px);
}
.aceite input:focus-visible + .aceite-caixa { box-shadow: 0 0 0 3px rgba(16,199,107,.3); }
.aceite.invalido .aceite-caixa { border-color: var(--vermelho); }
.aceite .link { font-weight: 500; }

.erro {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
  background: rgba(255,90,95,.1); color: #ff8a8e; font-size: 13px;
}
.troca { text-align: center; margin: 16px 0 0; font-size: 13.5px; color: var(--texto-2); }
.troca + .troca { margin-top: 12px; }

/* ---------- Aviso (toast) ---------- */
.aviso {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 100;
  padding: 12px 18px; border-radius: 12px;
  background: #121315; border: 1px solid var(--borda);
  font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,.6);
  animation: subir .25s ease-out;
}

/* ---------- Animações ---------- */
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.aviso { animation-name: subirAviso; }
@keyframes subirAviso { from { opacity: 0; transform: translate(-50%, 12px); } }
@keyframes girar { to { transform: translate(-50%,-50%) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Celular ---------- */
@media (max-width: 720px) {
  .modal { padding: 0; align-items: end; }
  .modal-caixa {
    grid-template-columns: 1fr;
    width: 100%; max-height: 94dvh;
    border-radius: 22px 22px 0 0; border-bottom: 0;
    padding: 14px 14px max(18px, env(safe-area-inset-bottom));
    overflow-y: auto; overscroll-behavior: contain;
    animation-name: subirCelular;
  }
  .modal-banner {
    min-height: 0; height: 96px; border-radius: 14px;
    flex-direction: row; align-items: center; padding: 0 20px;
  }
  .banner-logo { font-size: 28px; text-align: left; }
  .banner-brilho { left: 46%; width: 140px; height: 140px; }
  .banner-brilho::after { inset: 52px; }
  .banner-texto { text-align: right; }
  .banner-texto strong { font-size: 20px; }
  .banner-texto span { font-size: 14px; margin-top: 2px; }
  .modal-corpo { padding: 20px 6px 4px; overflow: visible; }
  .modal-fechar { top: 16px; right: 4px; }
  .topo { padding-left: 16px; padding-right: 16px; }
  .topo .btn { height: 38px; padding: 0 14px; }
  .hero-botoes .btn { flex: 1 1 100%; }
}
@keyframes subirCelular { from { transform: translateY(100%); } }
