/* Telas de acesso do Postfy (entrar, criar conta, confirmar e-mail, senha). */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }

.pagina {
  min-height: 100%;
  display: grid; place-items: center;
  padding: 24px 16px;
}

/* Cartão de duas colunas (imagem + formulário), como no modelo. */
.acesso {
  width: 100%; max-width: 1080px; min-height: 640px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

/* ---------- Lado da imagem ---------- */
.lateral {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 28px;
  padding: 40px;
  border-radius: 18px;
  color: #f0faf6;
  background: #0b1210 url("/assets/img/postfy-fundo-1000.webp") center / cover no-repeat;
}
.lateral::before {
  /* Escurece a base para o texto branco ter contraste sobre o verde claro. */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(5, 10, 9, .15) 0%, rgba(5, 10, 9, .35) 45%, rgba(5, 10, 9, .82) 100%);
}
.lateral-texto { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: end; }
.lateral h2 {
  margin: 0; font-size: clamp(26px, 2.7vw, 36px); font-weight: 500; line-height: 1.15; letter-spacing: -.02em;
  text-wrap: balance;
}
.lateral p { margin: 0; font-size: 14px; color: rgba(240, 250, 246, .82); text-wrap: pretty; }

.etapas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.etapa {
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  min-height: 132px; padding: 16px;
  border-radius: 14px;
  background: rgba(240, 250, 246, .12);
  border: 1px solid rgba(240, 250, 246, .14);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 14px; font-weight: 500; line-height: 1.3; color: rgba(240, 250, 246, .78);
}
.etapa-num {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font-size: 12px; font-weight: 600;
  background: rgba(240, 250, 246, .2); color: #f0faf6;
}
.etapa[aria-current="step"] { background: #f0faf6; border-color: #f0faf6; color: #101615; }
.etapa[aria-current="step"] .etapa-num { background: #101615; color: #f0faf6; }
.etapa-feita .etapa-num { background: var(--primary); color: var(--primary-foreground); }
[data-theme="claro"] .etapa-feita .etapa-num { background: #54e6be; color: #101615; }

/* ---------- Lado do formulário ---------- */
.lado-form { position: relative; display: flex; flex-direction: column; padding: 28px 24px; }
.lado-form-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.marca { display: block; line-height: 0; border-radius: 6px; }
.marca img { height: 44px; width: auto; }
.logo-claro { display: none; }
[data-theme="claro"] .logo-escuro { display: none; }
[data-theme="claro"] .logo-claro { display: block; }

.form-caixa { width: 100%; max-width: 380px; margin: auto; padding: 32px 0; }
.form-caixa h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.02em; text-align: center; }
.form-caixa .sub { margin: 6px 0 28px; color: var(--muted-foreground); text-align: center; text-wrap: pretty; }

.campo { margin-bottom: 16px; }
.campo label, .rotulo-linha label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.rotulo-linha { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rotulo-linha a { font-size: 12.5px; font-weight: 500; color: var(--primary); text-decoration: none; margin-bottom: 6px; }
.rotulo-linha a:hover { text-decoration: underline; text-underline-offset: 3px; }

.entrada { position: relative; }
.entrada input {
  width: 100%; height: 44px; padding: 0 14px;
  background: var(--input); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.entrada input::placeholder { color: var(--subtle); opacity: 1; }
.entrada input:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.entrada input[aria-invalid="true"] { border-color: var(--destructive); }
.entrada input[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 30%, transparent); }
.entrada input[readonly] { color: var(--muted-foreground); }
.entrada.com-olho input { padding-right: 48px; }
.olho {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: none; border: 0; border-radius: 8px; color: var(--subtle);
}
.olho:hover { color: var(--foreground); background: var(--elevated); }
.olho svg { width: 18px; height: 18px; }
.olho:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }

.ajuda { margin: 6px 0 0; font-size: 12.5px; color: var(--muted-foreground); }
.erro { margin: 6px 0 0; font-size: 12.5px; color: var(--destructive); }

.marcar { display: flex; align-items: center; gap: 10px; margin: 4px 0 20px; font-size: 13.5px; cursor: pointer; width: fit-content; }
.marcar input {
  appearance: none; flex: none; display: grid; place-content: center;
  width: 18px; height: 18px; margin: 0; cursor: pointer;
  background: var(--input); border: 1px solid var(--subtle); border-radius: 5px;
}
.marcar input::before {
  content: ""; width: 10px; height: 6px; margin-top: -2px;
  border-left: 2px solid var(--primary-foreground); border-bottom: 2px solid var(--primary-foreground);
  transform: rotate(-45deg) scale(0); transition: transform .12s;
}
.marcar input:checked { background: var(--primary); border-color: var(--primary); }
.marcar input:checked::before { transform: rotate(-45deg) scale(1); }
.marcar input:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; cursor: pointer; white-space: nowrap;
  font-size: 14px; font-weight: 600; line-height: 1;
  border: 1px solid transparent; border-radius: 10px;
  transition: background-color .15s, border-color .15s, box-shadow .15s, opacity .15s;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primario { width: 100%; background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-sm); }
.btn-primario:hover:not(:disabled) { background: var(--primary-hover); }
.btn-contorno { width: 100%; background: transparent; border-color: var(--border); color: var(--foreground); }
.btn-contorno:hover { background: var(--elevated); }
.btn-icone { width: 40px; height: 40px; padding: 0; background: transparent; color: var(--foreground); }
.btn-icone:hover { background: var(--elevated); }
.btn-icone svg { width: 18px; height: 18px; }
.botoes { display: grid; gap: 10px; }

.rodape-form { margin: 24px 0 0; text-align: center; font-size: 13.5px; color: var(--muted-foreground); }
.rodape-form a, .link-botao { color: var(--foreground); font-weight: 600; text-decoration: none; }
.rodape-form a:hover, .link-botao:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-botao { background: none; border: 0; padding: 0; cursor: pointer; font-size: inherit; }

.alerta {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0 0 20px; padding: 12px 14px; border-radius: 10px; font-size: 13px;
  border: 1px solid color-mix(in srgb, var(--success) 50%, transparent);
  background: color-mix(in srgb, var(--success) 10%, transparent);
}
.alerta svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--success); }
.alerta.ruim { border-color: color-mix(in srgb, var(--destructive) 50%, transparent); background: color-mix(in srgb, var(--destructive) 10%, transparent); }
.alerta.ruim svg { color: var(--destructive); }

.icone-envelope {
  display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 16px;
  background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-line);
}
.icone-envelope svg { width: 26px; height: 26px; }
.texto { color: var(--muted-foreground); text-align: center; margin: 0 0 24px; text-wrap: pretty; }
.texto strong { color: var(--foreground); font-weight: 600; word-break: break-all; }

.so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Tablet e celular ---------- */
@media (max-width: 900px) {
  .lateral { padding: 28px; }
  .lateral-texto { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .etapa { min-height: 112px; padding: 14px; font-size: 13px; }
}
@media (max-width: 760px) {
  .pagina { padding: 0; place-items: stretch; }
  .acesso { grid-template-columns: minmax(0, 1fr); min-height: 100%; border: 0; border-radius: 0; box-shadow: none; padding: 8px; }
  .lateral {
    order: 2; padding: 24px 20px; gap: 18px; border-radius: 16px;
    background-image: url("/assets/img/postfy-fundo-600.webp");
  }
  .lateral h2 { font-size: 24px; }
  .etapa { min-height: 0; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; padding: 10px 12px; font-size: 12.5px; }
  .etapas { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .lado-form { padding: 16px 12px 8px; }
  .form-caixa { padding: 28px 0 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
