/* Component layer.

   The audit found the same three primitives re-authored per view: 702
   distinct class strings across 1,203 call sites, 514 of them used exactly
   once. These classes are the canonical forms, built from tokens so they
   are theme-aware for free and cannot drift into a fourth palette.

   Geometry is not invented — it is lifted from the components already
   shipped in owner_shell.css (button padding 10px/18px at weight 650,
   radius 8px; card radius 16px; field radius 6px).

   Available on every surface: these are unscoped, unlike the migration
   bridge in surface_tokens.css. */

/* ---------- Button ---------- */

.fc-btn {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--fc-radius-button);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--fc-font-body);
  font-size: 0.875rem;
  font-weight: 650;
  gap: 0.5rem;
  justify-content: center;
  line-height: 1;
  padding: 0.625rem 1.125rem;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.fc-btn:focus-visible {
  outline: 2px solid var(--fc-accent-ink);
  outline-offset: 2px;
}

.fc-btn:disabled,
.fc-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

.fc-btn--primary {
  background: var(--fc-accent-fill);
  color: var(--fc-accent-on);
}

.fc-btn--primary:hover {
  background: var(--fc-accent-hover);
  box-shadow: 0 6px 14px rgb(var(--fc-accent-rgb) / 0.22);
}

.fc-btn--secondary {
  background: var(--fc-surface);
  border-color: var(--fc-border-strong);
  color: var(--fc-text);
}

.fc-btn--secondary:hover {
  background: var(--fc-accent-subtle);
  border-color: var(--fc-accent-fill);
  color: var(--fc-accent-ink);
}

.fc-btn--ghost {
  background: transparent;
  color: var(--fc-text-muted);
}

.fc-btn--ghost:hover {
  background: var(--fc-surface-muted);
  color: var(--fc-text);
}

.fc-btn--danger {
  background: var(--fc-error);
  color: var(--fc-error-on);
}

.fc-btn--danger:hover { filter: brightness(0.93); }

/* Sizes. Large is the member-portal default: 44px is the minimum touch
   target, which the audit found the portal was not meeting. */
.fc-btn--sm { font-size: 0.8125rem; padding: 0.4375rem 0.875rem; }
.fc-btn--lg { font-size: 0.9375rem; min-height: 2.75rem; padding: 0.75rem 1.25rem; }
.fc-btn--block { display: flex; width: 100%; }

/* ---------- Badge ---------- */

.fc-badge {
  align-items: center;
  border-radius: var(--fc-radius-pill);
  display: inline-flex;
  font-family: var(--fc-font-body);
  font-size: 0.75rem;
  font-weight: 600;
  gap: 0.3125rem;
  line-height: 1.25;
  padding: 0.25rem 0.625rem;
  white-space: nowrap;
}

/* One badge text size; --lg varies padding only. */
.fc-badge--lg { padding: 0.3125rem 0.75rem; }

.fc-badge--neutral { background: var(--fc-surface-muted); color: var(--fc-text-muted); }
.fc-badge--accent  { background: var(--fc-accent-soft); color: var(--fc-accent-ink); }
.fc-badge--success { background: var(--fc-success-tint); color: var(--fc-success); }
.fc-badge--warning { background: var(--fc-warning-tint); color: var(--fc-warning); }
.fc-badge--error   { background: var(--fc-error-tint); color: var(--fc-error); }
.fc-badge--info    { background: var(--fc-info-tint); color: var(--fc-info); }

/* ---------- Field ---------- */

.fc-field {
  background: var(--fc-surface);
  border: 1px solid var(--fc-border-strong);
  border-radius: var(--fc-radius-input);
  color: var(--fc-text);
  display: block;
  font-family: var(--fc-font-body);
  font-size: 0.875rem;
  padding: 0.625rem 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.fc-field::placeholder { color: var(--fc-text-soft); }

.fc-field:focus,
.fc-field:focus-visible {
  border-color: var(--fc-accent-ink);
  box-shadow: 0 0 0 3px var(--fc-accent-subtle);
  outline: none;
}

.fc-field[aria-invalid="true"] {
  border-color: var(--fc-error);
}

.fc-label {
  color: var(--fc-text);
  display: block;
  font-family: var(--fc-font-body);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

/* ---------- Card ---------- */

.fc-card {
  background: var(--fc-surface);
  border: 1px solid var(--fc-border);
  border-radius: var(--fc-radius-card);
  box-shadow: var(--fc-shadow-sm);
}

.fc-card--interactive { transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
.fc-card--interactive:hover {
  border-color: var(--fc-accent-fill);
  box-shadow: var(--fc-shadow-md);
  transform: translateY(-2px);
}

.fc-card__header {
  border-bottom: 1px solid var(--fc-border);
  padding: 1.25rem 1.5rem;
}

.fc-card__body { padding: 1.5rem; }

/* ---------- Icon tile ---------- */

.fc-tile {
  align-items: center;
  background: var(--fc-accent-soft);
  border-radius: var(--fc-radius-tile);
  color: var(--fc-accent-ink);
  display: inline-flex;
  flex-shrink: 0;
  height: 2.5rem;
  justify-content: center;
  width: 2.5rem;
}

.fc-tile--lg { height: 3rem; width: 3rem; }
.fc-tile--neutral { background: var(--fc-surface-muted); color: var(--fc-text-muted); }
.fc-tile--success { background: var(--fc-success-tint); color: var(--fc-success); }
.fc-tile--warning { background: var(--fc-warning-tint); color: var(--fc-warning); }
.fc-tile--error   { background: var(--fc-error-tint); color: var(--fc-error); }

/* ---------- Stat tile ---------- */

.fc-stat {
  background: var(--fc-surface);
  border: 1px solid var(--fc-border);
  border-radius: var(--fc-radius-card);
  overflow: hidden;
  padding: 1.5rem;
  position: relative;
  transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* The one place coral is correct on a product surface: a decorative rule,
   not a control and not text. */
.fc-stat::before {
  background: linear-gradient(90deg, var(--fc-brand-coral), var(--fc-brand-gold));
  content: "";
  height: 3px;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: opacity 0.3s;
}

.fc-stat:hover::before { opacity: 1; }
.fc-stat:hover { box-shadow: var(--fc-shadow-md); }

.fc-stat__label {
  color: var(--fc-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.fc-stat__value {
  color: var(--fc-text);
  font-family: var(--fc-font-display);
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.fc-stat__note {
  color: var(--fc-text-muted);
  font-size: 0.75rem;
  line-height: 1.5;
  margin-top: 0.75rem;
}

/* ---------- Empty state ---------- */

.fc-empty__icon {
  align-items: center;
  background: var(--fc-surface-muted);
  border-radius: var(--fc-radius-pill);
  color: var(--fc-text-soft);
  display: inline-flex;
  height: 4rem;
  justify-content: center;
  margin-bottom: 1rem;
  width: 4rem;
}

.fc-empty__text {
  color: var(--fc-text-muted);
  font-size: 0.875rem;
  margin: 0 auto 1.5rem;
  max-width: 24rem;
}

/* ---------- Page header ---------- */

.fc-card__subtitle { color: var(--fc-text-muted); font-size: 0.875rem; }

.fc-page-header__description {
  color: var(--fc-text-muted);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.fc-crumb {
  align-items: center;
  color: var(--fc-text-muted);
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.fc-crumb:hover { color: var(--fc-accent-ink); }
.fc-crumb--current { color: var(--fc-text); }

.fc-crumb__sep { color: var(--fc-text-soft); flex-shrink: 0; }
