/* ============================================================
   Auth pages — DSv2 design system
   Escopado em .auth-wrap para não vazar para outros Dash apps
   ============================================================ */

/* ── Reset de body no contexto auth ── */
body:has(.auth-wrap) {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.08), transparent 30%),
    radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.08), transparent 28%),
    linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Wrapper full-screen ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(to right, rgba(9,9,11,.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(9,9,11,.04) 1px, transparent 1px),
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.08), transparent 30%),
    radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.08), transparent 28%),
    linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
  background-size: 36px 36px, 36px 36px, auto, auto, auto;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding: 1.5rem 1rem;
}

/* ── Card central ── */
.auth-card {
  background: rgba(255,255,255,.84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 1.5rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 24px 64px rgba(9, 9, 11, 0.12), 0 1px 4px rgba(9, 9, 11, 0.04);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at top right, rgba(99,102,241,.08), transparent 35%);
  pointer-events: none;
}

/* ── Logo mark (círculo decorativo) ── */
.auth-logo-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.28);
}

/* ── Títulos ── */
.auth-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: #09090b;
  letter-spacing: -0.05em;
  line-height: 1.05;
  margin: 0 0 0.375rem;
  position: relative;
}

.auth-subtitle {
  font-size: 0.9375rem;
  color: #52525b;
  margin: 0 0 1.75rem;
  line-height: 1.65;
  max-width: 30ch;
}

/* ── Campos ── */
.auth-fields {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

/* Dash renderiza dcc.Input como <input> direto */
.auth-fields input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(255,255,255,.96);
  color: #09090b;
  border: 1px solid #e4e4e7;
  border-radius: 0.625rem;
  font-size: 0.9375rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  box-sizing: border-box;
}

.auth-fields input::placeholder {
  color: #a1a1aa;
}

.auth-fields input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* ── Botão primário ── */
.auth-btn {
  width: 100%;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #09090b 0%, #18181b 100%);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  margin-top: 0.25rem;
  letter-spacing: -0.01em;
}

.auth-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -8px rgba(9, 9, 11, 0.36);
}

.auth-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Mensagem de erro / feedback ── */
.auth-error {
  font-size: 0.8125rem;
  color: #ef4444;
  min-height: 1.25rem;
  margin-top: 0.375rem;
  line-height: 1.4;
}

.auth-error.success-msg {
  color: #10b981;
}

/* ── Debug (oculto visualmente em prod) ── */
.auth-debug {
  font-size: 0.6875rem;
  color: #a1a1aa;
  margin-top: 0.5rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Spinner loading ── */
.auth-loading {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

/* ── Link de alternância login/register ── */
.auth-link-row {
  display: block;
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: #52525b;
  text-decoration: none;
}

.auth-link-row a,
a.auth-link-row {
  color: #6366f1;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-link-row a:hover,
a.auth-link-row:hover {
  color: #4f46e5;
  text-decoration: underline;
}

/* ── Divider entre campos e link ── */
.auth-divider {
  height: 1px;
  background: #e4e4e7;
  margin: 1.5rem 0;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.75rem 1.25rem;
    border-radius: 1rem;
  }

  .auth-title {
    font-size: 1.8rem;
  }
}
