/* =========================================================
   TELAS DE ACESSO (login, cadastro, recuperar e nova senha)
   ========================================================= */

body.auth-body {
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(255, 106, 19, 0.10), transparent 70%),
    var(--bg);
}

body.auth-body .app-shell { max-width: 460px; }

.auth-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: 32px 18px;
}

.auth-wrap { width: 100%; }

.auth-logo { display: flex; justify-content: center; margin-bottom: 26px; }
.auth-logo img { height: 42px; width: auto; display: block; }

.auth-wrap .page-header { margin-bottom: 22px; }
.auth-wrap h1 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: clamp(24px, 6vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.auth-wrap .subtitle { margin: 0 auto; font-size: 14px; }

.auth-panel {
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px rgba(16, 24, 40, 0.07);
}

/* Abas Entrar / Criar conta */
.auth-tabs {
  display: flex;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.10);
}

.auth-form { display: none; flex-direction: column; }
.auth-form.active { display: flex; }
.auth-form .field--full { margin-bottom: 16px; }

.auth-form input {
  background: var(--field);
  border: 1px solid var(--border);
  color: var(--text);
}
.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #fff;
}

.pw-wrap { position: relative; display: flex; }
.pw-wrap input { padding-right: 44px; width: 100%; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; color: var(--muted);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 8px;
}
.pw-toggle:hover, .pw-toggle.active { color: var(--accent); background: var(--accent-soft); }

.link-btn {
  align-self: flex-end;
  background: none; border: none; color: var(--accent);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; margin: -4px 0 18px; padding: 2px 0;
}
.link-btn:hover { text-decoration: underline; }
.link-btn--center { align-self: center; margin: 16px 0 0; }

.recover-info {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--accent-soft); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 18px;
  font-size: 13px; line-height: 1.5; color: #7a3a0f;
}
.recover-info svg { flex-shrink: 0; color: var(--accent); margin-top: 1px; }

/* Avisos */
.auth-alert {
  display: none; font-size: 13.5px; line-height: 1.5;
  padding: 12px 14px; border-radius: 12px; margin-bottom: 16px;
}
.auth-alert.show { display: block; }
.auth-alert.error {
  background: rgba(229, 72, 77, 0.08);
  border: 1px solid rgba(229, 72, 77, 0.25);
  color: #b4232a;
}
.auth-alert.success {
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.25);
  color: #15803d;
}

.termos-aceite__label { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; font-weight: 500; color: var(--text); cursor: pointer; }
.termos-aceite__label input { width: 18px; height: 18px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--accent); }
.termos-aceite__label a, .auth-footnote a { color: var(--accent); font-weight: 600; }
.auth-footnote a { color: var(--muted); }

.auth-footnote {
  text-align: center; color: var(--muted);
  font-size: 12px; line-height: 1.5; margin: 18px 0 0; padding: 0 10px;
}

#loginBtn svg, #signupBtn svg, #recoverBtn svg, #newPasswordBtn svg { flex-shrink: 0; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Página de nova senha: estado "verificando link" */
.auth-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 0; color: var(--muted); font-size: 14px; }
.auth-loading .spinner { width: 26px; height: 26px; border-color: var(--accent-soft); border-top-color: var(--accent); }
.auth-state { display: none; }
.auth-state.active { display: block; }

@media (max-width: 380px) {
  .auth-panel { padding: 18px; }
}

.auth-cta {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 14px; border-radius: var(--radius-md);
  background: var(--accent); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none;
}
.auth-cta:hover { filter: brightness(1.07); }
.auth-footlink { color: var(--muted); font-weight: 600; text-decoration: none; }
.auth-footlink:hover { color: var(--accent); }
.auth-tabs[hidden] { display: none; }

/* Entrar com Google e outros */
.auth-social[hidden] { display: none; }
.auth-social__btns { display: flex; flex-direction: column; gap: 10px; }
.auth-social-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 46px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--panel, transparent); color: var(--text);
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; box-shadow: none;
}
.auth-social-btn:hover { border-color: var(--accent); }
.auth-social-btn[disabled] { opacity: .6; cursor: wait; }
.auth-social__nota { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); text-align: center; }
.auth-social__nota a { color: var(--accent); font-weight: 600; }
.auth-sep { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--muted); font-size: 12.5px; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Trocar a senha com o código do e-mail */
.recover-codigo[hidden] { display: none; }
.recover-codigo { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; }
#recoverCode { letter-spacing: 4px; font-weight: 700; }
#recoverCodeBtn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 14px; margin-top: 4px;
  border: none; border-radius: var(--radius-md); background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
#recoverCodeBtn:hover:not(:disabled) { filter: brightness(1.08); }
#recoverCodeBtn:disabled { opacity: .6; cursor: not-allowed; }
