@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.auth-body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #0a0a2e 0%, #1a0a3e 50%, #2a0a2e 100%);
  color: #eee;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.auth-box {
  background: rgba(20, 10, 40, 0.92);
  border: 2px solid #8b5cf6;
  border-radius: 20px;
  padding: 36px 32px;
  text-align: center;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.25);
}

.auth-box-wide { max-width: 440px; }

.auth-box h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #c4b5fd;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.auth-box .subtitle {
  color: #7c3aed;
  margin-bottom: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}

.auth-preview {
  width: 110px;
  height: auto;
  border-radius: 12px;
  border: 2px solid #6d28d9;
  margin-bottom: 20px;
  background: #fff;
}

/* ── Inputs padronizados ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.auth-input,
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="date"] {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid rgba(109, 40, 217, 0.6);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  color: #f3f4f6;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-input::placeholder,
.auth-form input::placeholder {
  color: rgba(167, 139, 250, 0.55);
  font-weight: 400;
}

.auth-input:focus,
.auth-form input:focus {
  border-color: #a78bfa;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.auth-input:disabled,
.auth-form input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.auth-input[type="date"] {
  color-scheme: dark;
}

.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  color: #a78bfa;
  font-size: 0.85rem;
  font-weight: 400;
  margin: 4px 0 4px;
  cursor: pointer;
}

.auth-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #7c3aed;
  cursor: pointer;
}

/* ── Botões ── */
.auth-btn {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  letter-spacing: 0.01em;
}

.auth-btn-primary {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  margin-top: 4px;
}

.auth-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
}

.auth-btn-secondary {
  background: rgba(124, 58, 237, 0.15);
  border: 1.5px solid rgba(124, 58, 237, 0.5);
  color: #c4b5fd;
  font-size: 0.9rem;
  padding: 12px 16px;
}

.auth-btn-secondary:hover:not(:disabled) {
  background: rgba(124, 58, 237, 0.28);
}

.auth-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ── Alertas ── */
.auth-alert {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
}

.auth-alert.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.auth-alert.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #86efac;
}

/* ── Links ── */
.auth-links {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-link {
  color: #a78bfa;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.auth-link:hover { color: #e9d5ff; }

/* ── Seções (recuperação) ── */
.auth-section {
  margin: 16px 0;
  padding: 18px;
  border: 1.5px solid rgba(139, 92, 246, 0.25);
  border-radius: 14px;
  text-align: left;
  background: rgba(0, 0, 0, 0.2);
}

.auth-section h3 {
  color: #c4b5fd;
  margin-bottom: 14px;
  font-size: 0.95rem;
  font-weight: 600;
}

.auth-hint {
  color: #7c3aed;
  font-size: 0.85rem;
  margin-bottom: 12px;
  font-weight: 500;
}

/* ── Overlay / toast ── */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  z-index: 300;
}

.auth-loading-panel {
  width: min(88vw, 320px);
  text-align: center;
  padding: 28px 24px;
  background: linear-gradient(160deg, #1a0a2e, #2d1b4e);
  border: 2px solid #8b5cf6;
  border-radius: 18px;
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.35);
}

.auth-loading-label {
  color: #c4b5fd;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.auth-overlay-top { z-index: 600; }

.auth-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a0a2e;
  border: 1.5px solid #7c3aed;
  padding: 12px 22px;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  z-index: 400;
}

.hidden { display: none !important; }

/* ── Modal verificação ── */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.auth-modal-panel {
  position: relative;
  background: rgba(20, 10, 40, 0.98);
  border: 2px solid #8b5cf6;
  border-radius: 20px;
  padding: 28px 24px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 0 50px rgba(139, 92, 246, 0.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-modal-panel h2 {
  color: #c4b5fd;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-modal-desc {
  color: #a78bfa;
  font-size: 0.9rem;
  font-weight: 500;
  word-break: break-all;
}

.auth-modal-hint {
  color: #7c3aed;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.auth-input-code {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  padding: 16px;
}

.auth-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  margin-top: 4px;
  font-family: inherit;
}

.auth-loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: rgba(20, 10, 40, 0.95);
  border: 2px solid #8b5cf6;
  border-radius: 16px;
  padding: 32px 40px;
}

.auth-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(139, 92, 246, 0.3);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

.auth-toast.error {
  border-color: #ef4444;
  color: #fca5a5;
}

.auth-toast.success {
  border-color: #22c55e;
  color: #86efac;
}

@media (max-width: 420px) {
  .auth-box { padding: 28px 20px; border-radius: 16px; }
  .auth-input, .auth-btn { border-radius: 10px; }
}
