/* ============================================================
   regio.immo — UI States: Loading, Error, Empty, Toast, Offline
   Sub-Agent W — 2026-05-07
   ============================================================ */

/* Loading States (Skeleton + Spinner) */
.fd-skeleton {
  background: linear-gradient(90deg, var(--bg-raised) 25%, var(--bg-base) 50%, var(--bg-raised) 75%);
  background-size: 200% 100%;
  animation: fd-shimmer 1.5s infinite;
  border-radius: var(--r-md);
  min-height: 1em;
}
@keyframes fd-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.fd-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid var(--accent-glow);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: fd-spin 0.7s linear infinite;
}
@keyframes fd-spin { to { transform: rotate(360deg); } }

/* Loading-Overlay for Cards */
.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}
.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 30%, rgba(167,139,250,0.1) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: fd-shimmer 1.2s infinite;
  pointer-events: none;
}

/* Error States */
.fd-error {
  padding: 16px;
  border-radius: var(--r-md);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.fd-error-icon    { font-size: 24px; margin-bottom: 8px; }
.fd-error-title   { font-weight: 600; margin-bottom: 4px; }
.fd-error-message { font-size: var(--fs-sm); color: var(--text-mid); }
.fd-error-retry {
  margin-top: 12px;
  padding: 6px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.fd-error-retry:hover { background: var(--accent-hi); }

/* Empty States enhanced */
.fd-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-mid);
}
.fd-empty-icon {
  font-size: 64px;
  opacity: 0.3;
  margin-bottom: 16px;
}
.fd-empty-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-hi);
  margin-bottom: 8px;
}
.fd-empty-message {
  margin-bottom: 20px;
  max-width: 400px;
  margin-inline: auto;
  line-height: 1.6;
}
.fd-empty-cta {
  display: inline-block;
  padding: 10px 24px;
  background: var(--accent);
  color: white;
  border-radius: var(--r-md);
  text-decoration: none;
  font-weight: 600;
}
.fd-empty-cta:hover { background: var(--accent-hi); }

/* Toast Notifications */
.fd-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fd-toast {
  padding: 12px 18px;
  background: var(--bg-raised);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  min-width: 280px;
  max-width: 420px;
  animation: fd-toast-in 0.3s ease-out;
}
.fd-toast.is-success { border-left-color: #22c55e; }
.fd-toast.is-error   { border-left-color: #ef4444; }
.fd-toast.is-warning { border-left-color: #fbbf24; }
@keyframes fd-toast-in {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* Inline Loading-Indicator (for Buttons) */
.fd-btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  opacity: 0.7;
}
.fd-btn-loading::before {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: fd-spin 0.6s linear infinite;
}

/* Property-Card Skeleton (image + 3 lines) */
.fd-property-skeleton {
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-raised);
}
.fd-property-skeleton .fd-skeleton-img  { height: 200px; }
.fd-property-skeleton .fd-skeleton-line {
  height: 14px;
  margin: 8px 14px;
}
.fd-property-skeleton .fd-skeleton-line:first-of-type {
  margin-top: 14px;
  width: 70%;
  height: 18px;
}

/* Inline Form Validation */
.fd-input-invalid {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.04);
}
.fd-input-error-text {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: #fca5a5;
}

/* Network-Offline Banner */
.fd-offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fbbf24;
  color: #422006;
  padding: 8px 16px;
  font-size: var(--fs-sm);
  text-align: center;
  z-index: 10000;
  display: none;
}
.fd-offline-banner.is-visible { display: block; }
