/* Design FP 13 (Trello YXvTaE0m): feedback components.
   .fp-toast: short message at the bottom centre. Info/success disappear after
   --fp-toast-duration (4 s, set in admin-state.js), an error stays until ×.
   Layer: --z-toast (300), above full-page lists (--z-screen 280), below dialogs. */

.fp-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--fp-toast-offset) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: var(--z-toast);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--fp-toast-min);
  width: max-content;
  max-width: min(calc(100vw - 2 * var(--fp-toast-offset)), 420px);
  padding: 6px 6px 6px 12px;
  border: 1px solid var(--fp-border);
  border-left: 4px solid var(--toast-accent, var(--fp-info));
  border-radius: var(--fp-radius-sm);
  background: var(--fp-surface);
  color: var(--fp-text);
  font-size: 0.875rem;
  line-height: 1.35;
  box-shadow: var(--fp-shadow);
}

.fp-toast.hidden {
  display: none;
}

.fp-toast--info {
  --toast-accent: var(--fp-info);
}

.fp-toast--success {
  --toast-accent: var(--fp-ok);
}

.fp-toast--error {
  --toast-accent: var(--fp-error);
  border-color: var(--fp-error);
  background: var(--fp-error-bg);
  color: var(--fp-error);
}

.fp-toast__msg {
  flex: 1 1 auto;
  min-width: 0;
}

.fp-toast__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.fp-toast__action,
.fp-toast__close {
  appearance: none;
  min-height: 32px;
  border: 1px solid var(--fp-border);
  border-radius: var(--fp-radius-sm);
  background: transparent;
  color: inherit;
  padding: 0 10px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.fp-toast__close {
  min-width: 32px;
  padding: 0;
  border-color: transparent;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1;
}

.fp-toast__action:hover,
.fp-toast__close:hover {
  background: var(--fp-surface-2);
}

.fp-toast--error .fp-toast__action:hover,
.fp-toast--error .fp-toast__close:hover {
  background: transparent;
  border-color: var(--fp-error);
}

.fp-toast__action:focus-visible,
.fp-toast__close:focus-visible {
  outline: none;
  box-shadow: var(--fp-focus-ring);
}

/* .fp-notice: hint inside the page (Design FP 13b). Coloured border and text,
   surface --fp-surface. Variants --info (default), --warn, --error, --success. */
.fp-notice {
  --notice-accent: var(--fp-info);
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 30px;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--notice-accent);
  border-radius: var(--fp-radius-sm);
  background: var(--fp-surface);
  color: var(--notice-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
}

.fp-notice--warn {
  --notice-accent: var(--fp-warn);
}

.fp-notice--error {
  --notice-accent: var(--fp-error);
}

.fp-notice--success {
  --notice-accent: var(--fp-ok);
}

/* .fp-empty: empty state (Design FP 13b). Dashed --fp-muted border, radius 12,
   centred. __icon, __title, __text, __action are optional; plain text inside
   .fp-empty reads like __text. */
.fp-empty {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--fp-muted);
  border-radius: var(--fp-radius);
  background: transparent;
  color: var(--fp-muted);
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: center;
  list-style: none;
}

.fp-empty.hidden {
  display: none;
}

.fp-empty__icon {
  width: 28px;
  height: 28px;
  color: var(--fp-muted);
}

.fp-empty__title {
  margin: 0;
  color: var(--fp-text);
  font-size: 0.875rem;
  font-weight: 700;
}

.fp-empty__text {
  margin: 0;
  font-size: 0.8125rem;
}

.fp-empty__action {
  margin-top: 4px;
}

/* .fp-spinner and .fp-skeleton: loading (Design FP 13c).
   Spinner 28 px, ring 3 px --fp-border, head --fp-signal. Skeleton bar 12 px,
   radius 6, --fp-surface-2 pulsing to --fp-surface-3. Both stand still with
   prefers-reduced-motion. */
.fp-spinner {
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 3px solid var(--fp-border);
  border-top-color: var(--fp-signal);
  border-radius: 50%;
  animation: fp-spin 0.75s linear infinite;
}

.fp-skeleton {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: var(--fp-surface-2);
  animation: fp-skeleton-pulse 1.2s ease-in-out infinite alternate;
}

@keyframes fp-spin {
  to { transform: rotate(360deg); }
}

@keyframes fp-skeleton-pulse {
  to { background: var(--fp-surface-3); }
}

@media (prefers-reduced-motion: reduce) {
  .fp-spinner,
  .fp-skeleton {
    animation: none;
  }
}
