/* ============================================================
   SentinelPeak Insurance — states.css
   Empty / loading / error states + animations.
   All animations gated by prefers-reduced-motion.
   ============================================================ */

/* ── EMPTY STATE ───────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 64px 24px;
  gap: 16px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
}

.empty-state-title {
  font-family: var(--font-family-heading);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-dark);
}

.empty-state-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 480px;
}

/* ── LOADING SKELETONS ─────────────────────────────────── */
.skeleton {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--color-border) 0%,
    rgba(221, 227, 232, 0.6) 50%,
    var(--color-border) 100%
  );
  background-size: 200% 100%;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-text--lg { height: 22px; }
.skeleton-text--sm { height: 10px; }

.skeleton-card {
  height: 240px;
  border-radius: var(--radius-md);
}

/* ── ERROR / SUCCESS / WARNING MESSAGES ────────────────── */
.error-message,
.success-message,
.warning-message {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.error-message {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid var(--color-error);
}

.success-message {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.warning-message {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning);
}

.error-banner {
  background: var(--color-error-bg);
  color: var(--color-error);
  padding: 12px 24px;
  text-align: center;
  font-size: 14px;
  border-bottom: 1px solid var(--color-error);
}

/* ── SPINNER ───────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-brand);
  border-radius: 50%;
  vertical-align: middle;
}

/* ── ANIMATIONS (prefers-reduced-motion guard) ─────────── */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  @keyframes slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @keyframes pop-in {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
  }

  /* Modal entrance — paired backdrop fade + content rise/scale.
     A small starting translate + scale plus a snappy cubic-bezier
     ease curve makes the open feel intentional and polished, rather
     than the previous "flash then appear" caused by the overlay
     showing instantly while content was still opacity 0. */
  @keyframes modal-overlay-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  @keyframes modal-content-enter {
    from { opacity: 0; transform: translateY(8px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
  }

  @keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }

  @keyframes spin {
    to { transform: rotate(360deg); }
  }

  .skeleton  { animation: shimmer 1.4s ease-in-out infinite; }
  .spinner   { animation: spin 0.8s linear infinite; }

  .modal-overlay   { animation: modal-overlay-fade 0.18s ease-out; }
  .modal-content   { animation: modal-content-enter 0.22s cubic-bezier(0.2, 0.85, 0.3, 1); }
  .cookie-consent  { animation: slide-up 0.3s ease-out; }
  .fade-in         { animation: fade-in 0.3s ease forwards; }
  .pop-in          { animation: pop-in 0.25s ease forwards; }
}

/* ── REDUCED MOTION OVERRIDE ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
