/* ==========================================================
   Telas de cadastro e login.
   Reaproveita as variáveis de cor do site (css/site.css).
   ========================================================== */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  position: relative;
  overflow: hidden;
}

/* Brilho de fundo, mesmo tratamento do hero */
.auth-wrap::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.18), transparent 70%);
  top: -200px;
  right: -150px;
  pointer-events: none;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.auth-logo {
  display: block;
  height: 44px;
  margin: 0 auto 22px;
}

.auth-title {
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  color: var(--muted);
  text-align: center;
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 26px;
}

.auth-field { margin-bottom: 16px; }

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 7px;
}

.auth-input {
  width: 100%;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 16px; /* 16px evita o zoom automático do iOS ao focar */
  font-family: inherit;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.16);
}

.auth-input::placeholder { color: #4b5563; }

.auth-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.auth-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.45;
}

.auth-btn {
  width: 100%;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.15s, opacity 0.15s;
}

.auth-btn:hover:not(:disabled) { transform: translateY(-1px); }
.auth-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.auth-btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 100%;
  border-radius: 12px;
  padding: 13px;
  font-size: 14.5px;
  font-family: inherit;
  cursor: pointer;
  margin-top: 10px;
}

.auth-btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }
.auth-btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; }

/* Mensagens */
.auth-msg {
  border-radius: 11px;
  padding: 13px 15px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 18px;
  display: none;
}

.auth-msg.show { display: block; }

.auth-msg.error {
  background: rgba(239, 68, 68, 0.11);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.auth-msg.success {
  background: rgba(16, 185, 129, 0.11);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.auth-msg.info {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.28);
  color: #67e8f9;
}

/* ── Caixa de primeiro acesso ──────────────────────────────
   Boa parte de quem usa esta tela tem pouca intimidade com tecnologia. Três
   decisões aqui são por causa disso:

   - o TÍTULO vem antes da explicação, porque é a linha que a pessoa lê
     primeiro e é ela que diz "não deu errado, é assim mesmo";
   - o texto é maior que o de uma mensagem normal — 15px, não 14;
   - o botão ocupa a largura toda e tem altura de alvo grande, porque dedo
     em celular erra alvo pequeno e a pessoa desiste achando que travou. */
.auth-msg-titulo {
  font-size: 16px;
  font-weight: 700;
  color: #a5f3fc;
  margin-bottom: 7px;
  line-height: 1.35;
}

.auth-msg-corpo {
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

/* É um <a>, não um <button>. Link é inline por natureza e não centraliza o
   próprio conteúdo — o mesmo detalhe que já tinha desalinhado o ícone do
   botão "Abrir Site" no painel. Daí o flex explícito. */
.auth-msg-acao {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 15px;
  text-decoration: none;
  color: #fff;
  font-size: 15.5px;
}

/* Campo de código: dígitos grandes e espaçados */
.auth-code-input {
  width: 100%;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  color: var(--text);
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.5em;
  text-indent: 0.5em; /* compensa o letter-spacing do último dígito */
  font-family: inherit;
}

.auth-code-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.16);
}

.auth-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  color: var(--muted);
}

.auth-footer a { color: var(--accent2); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

.auth-step { display: none; }
.auth-step.active { display: block; }

.auth-back {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
  font-family: inherit;
}

.auth-back:hover { color: var(--text); }

/* Caixa que aparece quando o histórico do cliente antigo é reencontrado */
.auth-legacy {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.26);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
}

.auth-legacy h4 {
  font-size: 15px;
  color: #6ee7b7;
  margin-bottom: 10px;
}

.auth-legacy dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 13.5px;
}

.auth-legacy dt { color: var(--muted); }
.auth-legacy dd { color: var(--text); font-weight: 600; text-align: right; }

.auth-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 7px;
}

@keyframes auth-spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; border-radius: 16px; }
  .auth-title { font-size: 23px; }
  .auth-code-input { font-size: 26px; letter-spacing: 0.35em; text-indent: 0.35em; }
}
