/* ================================================================
   UTILITIES — Toast, loading screen, empty state, animações
   ================================================================ */

/* ── Loading screen ──────────────────────────────────────────── */
#loadingScreen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.ld-logo {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  color: var(--purple);
}

.ld-sub { font-size: 13px; color: var(--muted); }

.ld-dots { display: flex; gap: 6px; margin-top: 6px; }

.ld-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--purple);
  animation: blink 1.2s infinite;
}

.ld-dot:nth-child(2) { animation-delay: 0.2s; }
.ld-dot:nth-child(3) { animation-delay: 0.4s; }

/* ── Toast ───────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: var(--s2);
  border: 1px solid var(--bdr2);
  color: var(--txt);
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 13px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 300;
  white-space: nowrap;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.toast-error   { background: var(--red-bg);   border-color: var(--red-d);   color: var(--red);   }
.toast.toast-warning { background: var(--amber-bg);  border-color: var(--amber);   color: var(--amber); }
.toast.toast-success { background: var(--green-bg);  border-color: var(--green-d); color: var(--green); }

/* ── Empty state ─────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 24px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

/* ── Animações globais ───────────────────────────────────────── */
@keyframes blink {
  0%, 80%, 100% { opacity: 0.15; }
  40%           { opacity: 1; }
}

/* ── Recurring delete dialog ─────────────────────────────────── */
.rdel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.rdel-backdrop.on { display: flex; }

.rdel-card {
  width: 100%;
  max-width: 440px;
  background: var(--s1);
  border: 1px solid var(--bdr2);
  border-radius: 24px 24px 16px 16px;
  padding: 28px 22px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.3);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.rdel-icon {
  font-size: 28px;
  color: var(--purple);
  margin-bottom: 4px;
}

.rdel-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--txt);
  text-align: center;
}

.rdel-desc {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 8px;
}

.rdel-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rdel-btn {
  width: 100%;
  padding: 13px;
  border-radius: var(--rs);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  border: none;
}

.rdel-btn:active { opacity: 0.75; }

.rdel-this {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-d);
}

.rdel-all {
  background: var(--red);
  color: #fff;
}

.rdel-cancel {
  background: var(--s2);
  color: var(--muted);
  border: 1px solid var(--bdr2);
}

/* ── Loading de troca de mês ─────────────────────────────────── */
#monthLoading {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: all;
}

#monthLoading.on { display: flex; }

.month-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.month-spinner-ring {
  width: 44px;
  height: 44px;
  border: 3.5px solid var(--bdr2);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.month-spinner-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
