/* Design system, part 2 of 7: buttons, forms, cards, notices, tables — shared by the app and the public site. */

.button,
button {
  --b-bg: var(--accent);
  --b-fg: var(--accent-text);
  --b-line: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--b-line);
  border-radius: var(--r);
  background: var(--b-bg);
  color: var(--b-fg);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    var(--shadow-xs),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

.button:hover,
button:hover {
  --b-bg: var(--accent-hover);
  --b-line: var(--accent-hover);
}

.button.secondary,
button.secondary {
  --b-bg: var(--surface);
  --b-fg: var(--text);
  --b-line: var(--border-strong);
}

.button.secondary:hover,
button.secondary:hover {
  --b-bg: var(--surface-2);
  --b-line: var(--text-dim);
}

button.danger,
button.danger:hover {
  --b-bg: var(--bad-solid);
  --b-fg: #ffffff;
  --b-line: var(--bad-solid);
}

button.link,
button.link:hover {
  --b-bg: transparent;
  --b-line: transparent;
  --b-fg: var(--accent-ink);
  min-height: 0;
  padding: 4px 2px;
  box-shadow: none;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.button.small,
button.small {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 0.875rem;
}

.button.big {
  min-height: 48px;
  padding: 11px 22px;
  font-size: 1rem;
  border-radius: 10px;
}

/* the display above would otherwise beat the hidden attribute (job page buttons start hidden) */
.button[hidden],
button[hidden] {
  display: none;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.inline {
  display: inline;
  margin: 0;
}

label {
  display: block;
  margin: 12px 0 6px;
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input:not([type]),
input[type="date"],
input[type="number"],
select {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

input:focus-visible,
select:focus-visible,
.button:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  box-shadow: var(--ring);
}

input[aria-invalid="true"] {
  border-color: var(--bad);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

select[multiple] {
  min-height: 7.5rem;
}

fieldset {
  margin: 16px 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

legend {
  padding: 0 6px;
  font-weight: 650;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 400;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 12px;
}

#stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 2px 12px;
}

.card {
  margin: 16px 0;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

.notice {
  margin: 16px 0;
  padding: 12px 16px;
  border: 1px solid var(--accent-line);
  border-left-width: 4px;
  border-left-color: var(--accent);
  border-radius: var(--r);
  background: var(--accent-soft);
  color: var(--text);
}

.notice.bad {
  border-color: var(--bad-line);
  border-left-color: var(--bad);
  background: var(--bad-soft);
}

.bad {
  color: var(--bad);
}

.ok {
  color: var(--ok);
}

.warn {
  color: var(--warn);
}

.tablewrap {
  overflow-x: auto;
  margin: 12px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th,
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

thead th {
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

td.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pill {
  display: inline-block;
  padding: 1px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 600;
}

progress {
  width: 100%;
  height: 12px;
  accent-color: var(--accent);
}

ul.tight {
  margin: 0.3em 0;
  padding-left: 1.2em;
}
