/*
 * Shared interactive primitives (Button, Input, Field) used across routes.
 * Login.css/AppShell.css declared the originals for Phase-0 wave 1; this file
 * promotes them to app-wide tokens so the admin/profile/forced-change surfaces
 * reuse the same token-driven controls. All values reference var(--…) only.
 */

.btn {
  min-height: var(--hit-min-height);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-body);
  font-family: var(--font-family-ui);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  transition:
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.btn:disabled {
  cursor: default;
  opacity: 0.7;
}

/* Accent — reserved for the single primary CTA per screen (UI-SPEC). */
.btn-primary {
  color: var(--color-accent-fg);
  border-color: transparent;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.26), transparent 1.4rem),
    linear-gradient(135deg, var(--color-accent), #5b5ff7);
  box-shadow: 0 10px 28px rgba(139, 92, 246, 0.24);
}

.btn-primary:hover:not(:disabled) {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.32), transparent 1.4rem),
    linear-gradient(135deg, var(--color-accent-2, #a78bfa), #6366f1);
}

/* Neutral secondary action (Cancel, etc.). */
.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-hover);
}

/* Destructive — reserved for Deactivate (and its confirm). */
.btn-destructive {
  background: var(--color-destructive);
  color: var(--color-accent-fg);
}

/* Square icon-only button (collapses the default horizontal padding to a
   uniform hit box). Compose with .btn .btn-ghost for a toolbar toggle. */
.icon-btn {
  width: var(--hit-min-height);
  min-width: var(--hit-min-height);
  padding: 0;
}

/* Ghost — low-emphasis inline action (row actions, top bar). */
.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-hover);
}

/* A row action that is semantically destructive but rendered restrained until
 * confirmed: destructive-colored text on a neutral surface. */
.btn-ghost-destructive {
  background: transparent;
  color: var(--color-destructive);
  border-color: var(--color-border);
}

.btn-ghost-destructive:hover:not(:disabled) {
  background: var(--color-hover);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.field-label {
  font-size: var(--font-size-label);
  line-height: var(--line-height-label);
  color: var(--color-text);
}

.field-error {
  font-size: var(--font-size-label);
  line-height: var(--line-height-label);
  color: var(--color-destructive);
}

.field-help {
  font-size: var(--font-size-label);
  line-height: var(--line-height-label);
  color: var(--color-text-muted);
}

.input {
  min-height: var(--hit-min-height);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-body);
  font-family: var(--font-family-ui);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.input::placeholder {
  color: var(--color-faint);
}

.input:hover:not(:focus-visible) {
  border-color: var(--color-border-strong);
}

.input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-color: var(--color-accent);
}

.select {
  min-height: var(--hit-min-height);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-body);
  font-family: var(--font-family-ui);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.spinner {
  animation: spin 0.8s linear infinite;
}

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