/* =========================================================
   Component — Card
   ========================================================= */
.card {
  --card-bg: var(--color-surface);
  --card-border: var(--color-line);
  --card-pad: var(--space-panel);
  --card-shadow: var(--shadow-soft);

  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--card-pad);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-premium);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  transition:
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}

.card--interactive:hover {
  --card-border: var(--color-line-strong);
  --card-shadow: var(--shadow-deep);
  transform: translateY(-2px);
}

/* Raised — for the one card that carries the page's weight. The
   teal glow is the only ambient light in the system. */
.card--raised {
  --card-bg: var(--color-surface-raised);
  /* The glow is the gold hairline and the ambient teal; the depth
     under it is what makes it sit above its neighbours rather than
     merely glowing on the same plane. */
  --card-shadow: var(--shadow-glow), var(--shadow-deep), var(--rim-light);
}

/* Premium — the gold hairline earns its place only on a plan or
   feature that actually costs more. */
.card--premium {
  --card-border: var(--color-line-gold);
  position: relative;
  overflow: hidden;
}
.card--premium::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 2px;
  background: var(--color-gold);
  opacity: 0.7;
}

.card__title {
  margin: 0;
  font-size: var(--fs-h4);
  color: var(--color-text);
}
.card__body {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
}
.card__footer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-4);
}

/* KPI tile — the dashboard's smallest unit of meaning */
.card--kpi { --card-pad: var(--space-5); gap: var(--space-2); }
.card--kpi .card__title {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--color-text-secondary);
}
.card__figure {
  font-family: var(--font-figures);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}
.card--kpi.is-active {
  --card-bg: var(--color-primary);
  --card-border: var(--color-primary);
}
.card--kpi.is-active .card__title,
.card--kpi.is-active .card__figure { color: var(--color-on-primary); }

/* The line under a KPI: what the figure is measured over, or why there is
   no figure. Muted and small — it is context for the number, never a second
   number competing with it. */
.card__note {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: var(--lh-snug);
  color: var(--color-text-muted);
}
