/* ══════════════════════════════════════════════════════════════
   LUNNA PRECIFICA — Auth Pages (Login / Cadastro)
   Card único centralizado — minimalista, foco total no formulário.
   Inspirado em Stripe / Notion / Linear / Vercel.
   ══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Montserrat:wght@400;500;600;700&display=swap');

:root {
  --purple-50:   #f5f0ff;
  --purple-100:  #ede5ff;
  --purple-500:  #8a4fff;
  --purple-600:  #7c3aed;
  --purple-700:  #6d28d9;
  --rose-400:    #ff7caa;
  --lilac-300:   #c9b6ff;
  --gray-100:    #f3f0f9;
  --gray-300:    #d4cce8;
  --gray-400:    #9d94b5;
  --gray-500:    #7a7295;
  --gray-600:    #5a5378;
  --gray-800:    #2a2448;
  --white:       #ffffff;
  --font-title:  'Poppins', system-ui, sans-serif;
  --font-body:   'Poppins', system-ui, sans-serif;
  --grad-primary: linear-gradient(135deg, #8a4fff 0%, #ff7caa 100%);
  --grad-bg:      linear-gradient(160deg, #ede5ff 0%, #f5f0ff 45%, #fdeef5 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font-body);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout — fundo em degradê, card único centralizado ────────── */
.auth-layout {
  min-height: 100vh;
  width: 100%;
  background: var(--grad-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.auth-card {
  width: 100%;
  max-width: 600px;
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(93,58,180,.14), 0 4px 16px rgba(93,58,180,.06);
  padding: clamp(32px, 5vw, 48px) clamp(28px, 5vw, 44px);
}

/* Logo */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(20px, 3.5vh, 32px);
}

.logo-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(124,58,237,.35);
  flex-shrink: 0;
}

.logo-mascot {
  width: 40px; height: 40px;
  object-fit: contain;
  border-radius: 12px;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 800;
  color: var(--gray-800);
  letter-spacing: -.2px;
}

/* Header */
.auth-header { margin-bottom: clamp(20px, 3vh, 28px); }
.auth-header h2 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-800);
  margin-bottom: 6px;
  letter-spacing: -.3px;
}
.auth-header p { font-size: 14px; color: var(--gray-400); line-height: 1.5; }

/* Alert */
.auth-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  line-height: 1.4;
}
.auth-alert.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.auth-alert.success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }

/* Fields */
.auth-field { margin-bottom: clamp(12px, 2vh, 18px); }

.auth-field label {
  display: block;
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  letter-spacing: .2px;
  margin-bottom: 6px;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 13px;
  font-size: 15px;
  pointer-events: none;
  z-index: 1;
}

.auth-input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1.5px solid var(--gray-300);
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  transition: all .25s ease;
  outline: none;
}
.auth-input::placeholder { color: var(--gray-400); }
.auth-input:hover  { border-color: var(--lilac-300); }
.auth-input:focus  {
  border-color: var(--rose-400);
  box-shadow: 0 0 0 4px rgba(255,124,170,.18);
}

.toggle-pass {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: var(--gray-400);
  padding: 4px;
  transition: color .2s;
  z-index: 1;
}
.toggle-pass:hover { color: var(--gray-700); }

/* Options */
.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(16px, 2.4vh, 22px);
  font-size: 13px;
}
.remember {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gray-600);
  cursor: pointer;
}
.remember input { accent-color: var(--purple-600); }
.auth-options a { color: var(--purple-600); font-weight: 600; }
.auth-options a:hover { text-decoration: underline; }

/* Botão principal */
.auth-btn {
  width: 100%;
  padding: 14px;
  background: var(--grad-primary);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 22px rgba(138,79,255,.38), 0 4px 10px rgba(255,124,170,.25);
  margin-bottom: clamp(14px, 2vh, 18px);
}
.auth-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 12px 30px rgba(138,79,255,.45), 0 6px 14px rgba(255,124,170,.35);
}
.auth-btn:active  { transform: translateY(0) scale(1); }
.auth-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Botão Google + divisor "ou" */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: clamp(18px, 2.6vh, 24px) 0;
  color: var(--gray-400);
  font-size: 12.5px;
  font-weight: 600;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-100); }

.auth-btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px;
  background: #fff;
  color: #3c3c43;
  border: 1.5px solid var(--gray-300);
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}
.auth-btn-google:hover { background: var(--purple-50); border-color: var(--lilac-300); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(91,33,182,.1); }
.auth-btn-google:active { transform: translateY(0); }

.auth-google-note { text-align: center; font-size: 11.5px; color: var(--gray-400); margin-top: -8px; margin-bottom: clamp(14px, 2vh, 18px); }

/* ── Cadastro — card mais largo (tem mais campos que o login) e
   ritmo vertical mais enxuto, pra caber na tela sem precisar de
   rolagem interna. Não afeta a tela de login. ──────────────────── */
.auth-card--cadastro {
  max-width: 620px;
  padding-top: clamp(22px, 3vh, 32px);
  padding-bottom: clamp(22px, 3vh, 32px);
}
.auth-card--cadastro .auth-logo { margin-bottom: clamp(10px, 1.6vh, 16px); }
.auth-card--cadastro .auth-header { margin-bottom: clamp(10px, 1.4vh, 16px); }
.auth-card--cadastro .auth-btn-google { padding: 11px; }
.auth-card--cadastro .auth-google-note { margin-top: 8px; margin-bottom: 0; }
.auth-card--cadastro .auth-divider { margin: clamp(10px, 1.4vh, 14px) 0; }
.auth-card--cadastro .auth-field { margin-bottom: clamp(8px, 1.2vh, 12px); }
.auth-card--cadastro .auth-field label { margin-bottom: 4px; }
.auth-card--cadastro .auth-input { padding-top: 10px; padding-bottom: 10px; }
.auth-card--cadastro .auth-btn { margin-bottom: clamp(8px, 1.2vh, 12px); }
.auth-card--cadastro .auth-security-note { margin-bottom: clamp(8px, 1.2vh, 12px); }

/* Nome+E-mail lado a lado, Senha+Confirmar lado a lado — só no
   desktop, pra cortar a altura do formulário praticamente pela
   metade. No mobile (ver media query lá embaixo) volta a empilhar,
   exatamente como já era antes. */
.auth-field-row {
  display: flex;
  gap: 14px;
}
.auth-field-row .auth-field { flex: 1; min-width: 0; }

/* Aviso de segurança */
.auth-security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: clamp(14px, 2vh, 20px);
  line-height: 1.4;
}

/* Switch */
.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--gray-500);
}
.auth-switch a {
  color: var(--purple-600);
  font-weight: 700;
  text-decoration: none;
  margin-left: 4px;
}
.auth-switch a:hover { text-decoration: underline; }

/* Spinner */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════
   MOBILE — mesmo conceito de card único, só reduz largura/padding.
   Sem layout em duas colunas em nenhum momento.
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 560px) {
  .auth-layout { padding: 20px 14px; align-items: flex-start; padding-top: clamp(24px, 6vh, 48px); }
  .auth-card { border-radius: 20px; }
  .auth-card--cadastro { max-height: none; overflow: visible; }
  .auth-field-row { flex-direction: column; gap: 0; }
}

@media (max-width: 380px) {
  .auth-card { padding: 28px 20px; }
}