/* ============================================================
   Bicharada — Telas de autenticação (Janela 2)
   Usa só os tokens de css/base.css (Nunito/Inter + paleta).
   Mobile-first, um cartão centrado.
   ============================================================ */

.app-root {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
}

/* --- Cartão ------------------------------------------------- */
.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 32px 24px;
  animation: auth-in 0.3s ease;
}

.auth-card--center {
  text-align: center;
}

@keyframes auth-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card { animation: none; }
}

/* --- Cabeçalho ---------------------------------------------- */
.auth-head {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo {
  margin: 0 auto 12px;
  border-radius: 20px;
  box-shadow: var(--sombra);
}

.auth-title {
  font-size: 1.5rem;
  color: var(--cor-texto);
}

.auth-sub {
  margin-top: 6px;
  font-size: 0.95rem;
  opacity: 0.7;
}

.auth-emoji {
  font-size: 2.75rem;
  margin-bottom: 8px;
}

.auth-email {
  font-weight: 600;
  color: var(--cor-primaria);
  margin: 4px 0 12px;
  word-break: break-all;
}

/* --- Formulário --------------------------------------------- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.85;
}

.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--cor-texto);
  background: var(--cor-fundo);
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 13px 14px;
  transition: border-color 0.15s, background 0.15s;
}

.field-input::placeholder {
  color: var(--cor-texto);
  opacity: 0.35;
}

.field-input:focus {
  outline: none;
  background: #fff;
  border-color: var(--cor-primaria);
}

.field-input.is-invalid {
  border-color: var(--cor-destaque);
  background: #fff;
}

/* Botão "Mostrar/Ocultar" senha */
.field-toggle {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--cor-primaria);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
}

.field-toggle:hover {
  background: rgba(45, 212, 160, 0.1);
}

.field-hint {
  font-size: 0.8rem;
  opacity: 0.6;
  margin-top: -8px;
}

.field-error {
  font-size: 0.82rem;
  color: var(--cor-destaque);
  min-height: 0;
  font-weight: 500;
}
.field-error:empty {
  display: none;
}

/* --- Banner de erro/aviso no topo do form ------------------- */
.form-banner {
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 12px;
  padding: 12px 14px;
  line-height: 1.4;
}
.form-banner[hidden] {
  display: none;
}
.form-banner--error {
  background: rgba(255, 107, 107, 0.12);
  color: #c0392b;
}
.form-banner--info,
.form-banner--success {
  background: rgba(45, 212, 160, 0.14);
  color: #12876a;
}

/* --- Botões ------------------------------------------------- */
.btn {
  width: 100%;
  font-family: var(--fonte-titulo);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  transition: transform 0.1s, opacity 0.15s, background 0.15s;
}
.btn:active {
  transform: scale(0.99);
}
.btn:disabled {
  cursor: default;
}

.btn--primary {
  background: var(--cor-primaria);
  color: #fff;
}
.btn--primary:hover:not(:disabled) {
  background: #27bd8f;
}
.btn--primary.is-loading,
.btn--primary:disabled {
  opacity: 0.65;
}

.btn--ghost {
  background: var(--cor-fundo);
  color: var(--cor-texto);
  margin-top: 4px;
}
.btn--ghost:hover:not(:disabled) {
  background: #efece7;
}

/* --- Links de texto ----------------------------------------- */
.auth-links {
  display: flex;
  justify-content: flex-end;
  margin-top: -6px;
}

.link {
  background: none;
  border: none;
  color: var(--cor-primaria);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 2px 0;
  text-decoration: none;
}
.link:hover {
  text-decoration: underline;
}
.link--inline {
  display: block;
  margin-top: 8px;
  text-align: left;
}

.auth-foot {
  text-align: center;
  margin-top: 20px;
  font-size: 0.92rem;
  opacity: 0.85;
}

/* --- Loading / spinner -------------------------------------- */
.auth-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  opacity: 0.7;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(45, 212, 160, 0.25);
  border-top-color: var(--cor-primaria);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
}
