/* ====================================================================
 * TrackPDV — entrar e criar conta (host do app)
 *
 * O resto vem do site.css, carregado antes: as cores, a Onest, a marca, os
 * botões em pílula, o .dark, o .kicker, o .t-hero, a tela do caixa
 * (.screen-card) e os selos (.hs-badge). Aqui fica só o que é desta tela:
 * a casca em duas metades, o formulário, o código de seis dígitos e os
 * avisos do api.js. As classes são as que o entrar.js conhece (conta__,
 * campo, aviso, otp…).
 * ==================================================================== */

:root {
  /* Nomes que o entrar.js usa na barra de força da senha. */
  --verde: var(--green);
  --amarelo: var(--amber);
  --campo-borda: #CBD1D9;
  --apagado: #8E97A6;
}

body.conta-pagina { background: var(--white); }

/* ---------- Casca ---------- */
.conta { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* O painel escuro é o topo do site: o brilho no canto, a marca, o título e a
   tela do caixa, que sai pela borda de baixo. Fica preso enquanto o
   formulário longo rola. */
.conta__lado {
  position: sticky; top: 16px;
  height: calc(100vh - 32px); height: calc(100dvh - 32px);
  margin: 16px 0 16px 16px; border-radius: 32px; overflow: hidden;
  display: flex; flex-direction: column; gap: 36px;
  padding: 40px clamp(32px, 4vw, 64px) 0;
  background: radial-gradient(120% 90% at 80% 10%, #2A4468 0%, var(--ink-2) 60%);
}
.conta__lado > .logo { align-self: flex-start; flex: none; }
.conta__copia { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.conta__lado .t-hero { font-size: clamp(34px, 3.4vw, 52px); }
.conta__lista { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
.conta__lista li { display: flex; gap: 12px; font-size: 16px; line-height: 1.5; color: #DCE3EC; }
.conta__lista svg { width: 18px; height: 18px; flex: none; margin-top: 3px; fill: none; stroke: var(--red-l); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* A tela passa da borda de baixo e o painel a corta: mostra o caixa sem
   disputar a altura com o texto. */
.conta__tela { position: relative; flex: none; width: 100%; max-width: 540px; margin-top: auto; margin-bottom: -56px; padding: 50px 0 0 28px; }
.conta__selo--pix { left: 0; top: 222px; }
/* Em cima da borda da tela, e não no meio da barra: ali cobria o número do cupom. */
.conta__selo--turno { right: -10px; top: 0; flex-direction: column; align-items: flex-start; gap: 2px; background: var(--red); color: var(--white); }
.conta__selo--turno small { color: rgba(255, 255, 255, .8); }

.conta__painel { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding: 24px clamp(24px, 5vw, 72px); }
.conta__topo { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex: none; }
/* No computador a marca já está no painel escuro, ao lado; aqui ela só
   aparece quando o painel some (celular). */
.conta__topo .logo { display: none; }
.conta__voltar { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.conta__voltar:hover { background: var(--bg); color: var(--ink); }
.conta__voltar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.conta__caixa { width: min(100%, 460px); margin: auto; padding: 32px 0; container-type: inline-size; }
.conta__caixa h1 { font-size: clamp(30px, 2.6vw, 38px); font-weight: 600; letter-spacing: -.025em; line-height: 1.1; margin-bottom: 10px; }
/* "e-mail" não quebra no hífen: "e-" numa linha e "mail" na outra. */
.conta__caixa h1 .inteiro { white-space: nowrap; }
.conta__caixa .lead { font-size: 16px; line-height: 1.55; margin-bottom: 28px; }
.conta__caixa .lead b { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.conta__passo.is-entrando { animation: contaPasso .35s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes contaPasso { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }

.conta__rodape { margin-top: 20px; text-align: center; font-size: 14.5px; color: var(--muted); }
.conta__rodape a, .aceite a, .campo__canto { color: var(--red-d); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.conta__rodape a:hover, .aceite a:hover, .campo__canto:hover { color: var(--ink); }
.conta__nota { display: flex; align-items: flex-start; gap: 12px; margin-top: 28px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--bg); font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.conta__nota svg { width: 20px; height: 20px; flex: none; margin-top: 1px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.conta__pe { flex: none; text-align: center; font-size: 13px; color: var(--muted); }
.conta__pe a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Formulário: os campos do contato do site ---------- */
.campo { position: relative; display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; font-size: 13px; font-weight: 600; }
/* "Esqueceu a senha?" vem depois do campo no HTML e aparece na linha do rótulo. */
.campo__canto { position: absolute; top: 0; right: 0; font-size: 13px; }
.campo input {
  width: 100%; height: 50px; padding: 0 14px;
  font: inherit; font-size: 15px; font-weight: 400; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--line); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.campo input::placeholder { color: var(--apagado); }
.campo input:hover { border-color: var(--campo-borda); }
.campo input:focus { outline: 0; border-color: var(--red); box-shadow: 0 0 0 4px rgba(224, 50, 43, .12); }
.campo small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
/* Nome e loja lado a lado quando o formulário tem largura para os dois. */
.campo-par { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
@container (max-width: 420px) { .campo-par { grid-template-columns: minmax(0, 1fr); } }

.conta__botao { width: 100%; min-height: 52px; font-size: 16px; }
.btn:disabled { cursor: default; opacity: .7; }
.btn-red:disabled:hover { background: var(--red); }

.aviso { margin-bottom: 18px; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; line-height: 1.45; }
.aviso--erro { background: var(--tint); color: var(--red-d); }
.aviso--ok { background: #E3F4EA; color: var(--green); }
.aviso--info { background: var(--bg); color: var(--ink); font-weight: 500; }

.senha { position: relative; display: block; }
.senha input { padding-right: 52px; }
.senha__olho {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  color: var(--apagado); transition: background .15s, color .15s;
}
.senha__olho:hover, .senha__olho.is-aberto { color: var(--ink); background: var(--bg); }
.senha__olho svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Força da senha: só um sinal para quem digita, a regra é o mínimo de caracteres. */
.forca { display: block; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.forca__barra { display: block; width: 0; height: 100%; border-radius: inherit; transition: width .3s, background .3s; }

.aceite { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 22px; font-size: 14px; line-height: 1.5; color: var(--muted); cursor: pointer; }
.aceite input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--red); cursor: pointer; }

/* ---------- Código do e-mail: seis caixas; na confirmação viram um anel, giram e somem no selo ---------- */
.otp { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.otp__caixas { display: flex; gap: 10px; transition: transform .5s cubic-bezier(.4, 0, .2, 1); }
.otp__caixa {
  width: 52px; height: 62px; padding: 0; text-align: center;
  font-family: var(--mono); font-size: 24px; font-weight: 500; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--line); border-radius: 12px; outline: none;
  transition: border-color .18s, background .18s, color .18s, box-shadow .18s, transform .18s;
}
.otp__caixa:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(224, 50, 43, .12); }
.otp__caixa.is-cheia { border-color: var(--muted-d); }
.otp__caixa.is-ok { border-color: var(--green); background: #E3F4EA; color: var(--green); transform: translateY(-4px); }
.otp__caixa.is-erro { border-color: var(--red); background: var(--tint); color: var(--red-d); }
/* Travadas durante a confirmação: sem isto o navegador pinta o dígito de
   cinza justo no quadro em que ele fica verde. */
.otp__caixa:disabled { opacity: 1; -webkit-text-fill-color: currentColor; cursor: default; }
.otp__caixas.is-tremendo { animation: otpTreme .4s; }
@keyframes otpTreme { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.otp.is-anel .otp__caixas { position: absolute; gap: 0; }
.otp.is-anel .otp__caixa {
  position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; font-size: 17px; border-radius: 50%;
  transform: translate(-50%, -50%) translate(var(--x), var(--y));
  transition: transform .55s cubic-bezier(.34, 1.3, .5, 1), width .55s, height .55s, font-size .55s, border-radius .55s, opacity .3s, border-color .3s, background .3s;
}
.otp.is-girando .otp__caixas { animation: otpGira 1.1s cubic-bezier(.5, 0, .3, 1) forwards; }
@keyframes otpGira { to { transform: rotate(360deg) scale(.18); opacity: 0; } }
.otp__selo {
  position: absolute; width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center;
  background: #E3F4EA; color: var(--green);
  opacity: 0; transform: scale(.4); transition: opacity .3s, transform .45s cubic-bezier(.34, 1.5, .6, 1);
}
.otp__selo svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.otp__selo.is-on { opacity: 1; transform: scale(1); }
.otp__selo::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid rgba(29, 122, 69, .35); opacity: 0; }
.otp__selo.is-on::after { animation: otpPulso 1.4s ease-out .15s infinite; }
@keyframes otpPulso { 0% { opacity: .8; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.35); } }
.otp__feito { margin: 0 0 10px; text-align: center; font-weight: 600; color: var(--green); opacity: 0; transition: opacity .3s; }
.otp__feito.is-on { opacity: 1; }

/* ---------- Avisos do api.js (queda de rede) ---------- */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 1000; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast {
  min-width: 260px; max-width: 420px; padding: 13px 18px; border-radius: var(--r-sm);
  background: var(--ink); color: var(--white); font-size: 14px; font-weight: 600; line-height: 1.4;
  box-shadow: 0 20px 40px -14px rgba(0, 0, 0, .45);
  opacity: 0; transform: translateY(10px); transition: opacity .22s, transform .22s;
}
.toast.is-in { opacity: 1; transform: none; }
.toast--success { background: var(--green); }
.toast--danger { background: var(--red-d); }
.toast--warning { background: var(--amber); color: var(--ink); }
.toast--info { background: var(--ink); }

/* Tela baixa: a tela do caixa sai, e o texto fica no meio do painel. */
@media (max-height: 700px) {
  .conta__tela { display: none; }
  .conta__copia { margin-block: auto; }
}

/* Celular e janela estreita: o painel escuro vira a barra do alto, com a
   marca e a volta ao site, e o formulário fica com a largura toda. */
@media (max-width: 960px) {
  .conta { grid-template-columns: minmax(0, 1fr); }
  .conta__lado { display: none; }
  .conta__painel { padding: 0 0 24px; }
  .conta__topo { justify-content: space-between; min-height: 68px; padding: 10px 12px 10px 20px; background: var(--ink); border-radius: 0 0 24px 24px; }
  .conta__topo .logo { display: inline-flex; color: var(--white); }
  .conta__voltar { color: var(--muted-d); }
  .conta__voltar:hover { background: rgba(255, 255, 255, .08); color: var(--white); }
  .conta__caixa { width: min(100% - 40px, 460px); margin: 0 auto; padding: 36px 0 32px; }
  .conta__pe { padding: 0 20px; }
}
@media (max-width: 420px) {
  .otp__caixas { gap: 8px; }
  .otp__caixa { width: 44px; height: 54px; font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .conta__passo, .otp__caixas, .otp__caixa, .otp__selo { transition: none !important; animation: none !important; }
  .otp.is-girando .otp__caixas { opacity: 0; }
}
