/* Shared form input and editable record field styling. */

.review-coords-field {
  display: grid;
  gap: 6px;
}

.review-coords-field span {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-coords-field input {
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(var(--ink-rgb), 0.08);
  background: rgba(var(--ink-rgb), 0.04);
  color: var(--text-main);
  font: inherit;
  font-size: 13px;
}

.review-coords-field input:focus {
  outline: none;
  border-color: rgba(var(--brand-blue-rgb), 0.44);
  box-shadow: var(--focus-ring);
}

.asset-register-search input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(var(--brand-blue-soft-rgb), 0.16);
  border-radius: 12px;
  background: transparent;
  color: var(--text-main);
  padding: 11px 12px;
  font: 13px/1.2 Inter, system-ui, sans-serif;
  letter-spacing: 0;
  outline: none;
}

.asset-register-search input:focus {
  border-color: rgba(var(--brand-blue-soft-rgb), 0.42);
  box-shadow: var(--focus-ring);
}

.tenant-register-table tr.is-selected td {
  background: rgba(var(--brand-blue-rgb), 0.08);
}

.tenant-register-table tr.is-selected .asset-register-asset-btn {
  color: var(--brand-blue-soft);
}

.asset-card-profile-form textarea {
  min-height: 96px;
  resize: vertical;
}

.asset-card-knowledge-diff pre,
.asset-card-knowledge-diff textarea {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: rgba(var(--text-pale-rgb), 0.86);
  font: 12px/1.45 "Inter", system-ui, sans-serif;
}

.asset-card-knowledge-diff textarea {
  width: 100%;
  min-height: 108px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  resize: vertical;
}

.asset-card-knowledge-diff textarea:focus {
  box-shadow: inset 0 -1px 0 rgba(var(--brand-orange-rgb), 0.45);
}

.work-card.is-selected {
  border-color: var(--brand-blue);
  background: var(--tint-brand);
}

.demo-edit-field {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.demo-edit-field span {
  color: var(--text-muted);
  font: 600 11px/1.2 "JetBrains Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.demo-edit-field input,
.demo-edit-field select,
.demo-edit-field textarea {
  min-width: 0;
  width: 100%;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid var(--input-line);
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-size: 13px;
}

.demo-edit-field select,
.work-record-field select {
  color-scheme: dark;
}

.demo-edit-field select option,
.work-record-field select option {
  background: var(--bg-panel-strong);
  color: var(--text-main);
}

.demo-edit-field select option:checked,
.work-record-field select option:checked {
  background: var(--brand-blue);
  color: var(--text-on-accent);
}

.demo-edit-field textarea {
  resize: vertical;
}

.demo-edit-field input:focus,
.demo-edit-field select:focus,
.demo-edit-field textarea:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: var(--focus-ring);
}

.work-record-field {
  display: grid;
  gap: 8px;
}

.work-record-field span,
.work-record-section h4 {
  color: var(--text-muted);
  font: 600 11px/1.2 "JetBrains Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.work-record-field input,
.work-record-field select,
.work-record-field textarea {
  width: 100%;
  border: 1px solid rgba(var(--ink-rgb), 0.08);
  border-radius: 16px;
  background: transparent;
  color: var(--text-main);
  padding: 12px 13px;
  font: inherit;
  font-size: 14px;
}

.work-record-field textarea {
  resize: vertical;
  min-height: 96px;
}

.work-record-field input:focus,
.work-record-field select:focus,
.work-record-field textarea:focus {
  outline: none;
  border-color: rgba(var(--brand-blue-rgb), 0.44);
  box-shadow: var(--focus-ring);
}

.work-record-field input:disabled {
  opacity: 0.72;
  cursor: default;
}

/* The Aleph brandbook switch (https://thealeph.tech/brandbook, "Switch"): a binary mode the user flips. The control
   carries role="switch" and aria-checked and the --focus-ring; the knob slides onto --brand-blue when on, and the
   On/Off word rides beside it, since colour is never the only signal. No motion under prefers-reduced-motion. */
.fm-switch-state {
  min-width: 26px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

[aria-checked="true"] > .fm-switch-state { color: var(--brand-blue-soft); }

.fm-switch {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--fill-recess);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.fm-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 2px 6px rgba(var(--shade-rgb), 0.4);
  transition: transform 0.18s ease, background 0.18s ease;
}

[aria-checked="true"] > .fm-switch {
  border-color: var(--brand-blue);
  background: linear-gradient(120deg, var(--brand-blue), var(--brand-blue-soft));
}

[aria-checked="true"] > .fm-switch .fm-switch-knob {
  background: var(--text-on-accent);
  transform: translateX(20px);
}

@media (prefers-reduced-motion: reduce) {
  .fm-switch,
  .fm-switch-knob { transition: none; }
}
