/*
 * Sash forms: import.html, send.html, policy.html.
 *
 * Tokens come from the CDN base.css and from css/style.css. Nothing here
 * redeclares a token, and nothing here styles the header, the footer or the
 * insignia kit: those three own their own CSS and a site-local override of any
 * of them is how the fleet drifts.
 *
 * Everything below is additive on top of style.css's .btn, .card, .section,
 * .container, .stack and .toolbar.
 */

/* ── prose (policy.html) ───────────────────────────────────────── */

.prose { max-width: 74ch; }

.prose p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

.prose p:last-child { margin-bottom: 0; }

.prose ul {
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.prose strong { color: var(--text-primary); }

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
}

/* A limit stated about a control, marked so it reads as part of the rule
   rather than as a caveat somebody can skim past. */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--surface-1);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--space-4) var(--space-6);
}

/* ── notes and status cards ────────────────────────────────────── */

.note__title {
  font-size: var(--text-base);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.note__list {
  color: var(--text-secondary);
  line-height: 1.65;
  padding-left: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.status {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: var(--text-secondary);
  line-height: 1.6;
}

.status strong { color: var(--text-primary); }
.status[data-state="pending"]  { border-color: var(--border-strong); }
.status[data-state="verified"] { border-color: rgba(64, 200, 130, .45); }
.status[data-state="unverified"] { border-color: rgba(225, 29, 72, .45); }

.status__dot {
  flex: none;
  width: 10px; height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}
.status[data-state="pending"]    .status__dot { background: #d9a441; animation: sash-pulse 1.1s ease-in-out infinite; }
.status[data-state="verified"]   .status__dot { background: #3fbe83; }
.status[data-state="unverified"] .status__dot { background: var(--danger); }

@keyframes sash-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

@media (prefers-reduced-motion: reduce) {
  .status[data-state="pending"] .status__dot { animation: none; }
}

/* ── tabs ──────────────────────────────────────────────────────── */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.tab {
  font: inherit;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 var(--space-4);
  height: var(--control-height-sm);
  cursor: pointer;
  transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}

.tab:hover { background: var(--surface-2); color: var(--text-primary); }

.tab.is-active {
  color: var(--text-primary);
  background: var(--surface-2);
  border-color: var(--accent);
}

.panel__lead {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.65;
  margin-bottom: var(--space-4);
}

/* ── fields ────────────────────────────────────────────────────── */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.field:last-child { margin-bottom: 0; }

.field__label {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: 600;
}

.field__hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.6;
}

.field__hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 1px 4px;
}

.input {
  font: inherit;
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 var(--space-3);
  height: var(--control-height);
  width: 100%;
  transition: border-color var(--dur) var(--ease-out);
}

.input:focus-visible {
  outline: none;
  border-color: var(--accent);
}

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

.input--area {
  height: auto;
  padding: var(--space-3);
  resize: vertical;
  line-height: 1.6;
}

.input--file {
  padding: var(--space-2) var(--space-3);
  height: auto;
  line-height: 1.5;
}

.input--file::file-selector-button {
  font: inherit;
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px var(--space-3);
  margin-right: var(--space-3);
  cursor: pointer;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

.counter { display: block; margin-top: 2px; }
.counter[data-over="yes"] { color: var(--danger); }

.muted { color: var(--text-muted); font-size: var(--text-sm); }

/* ── messages ──────────────────────────────────────────────────── */

.form-error {
  color: var(--danger);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-top: var(--space-3);
}

.form-note {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-top: var(--space-2);
}

/* ── preview (import.html and send.html) ───────────────────────── */

.preview {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: var(--space-6);
  align-items: start;
}

@media (max-width: 760px) {
  .preview { grid-template-columns: 1fr; }
}

.preview__art {
  display: flex;
  justify-content: center;
}

.preview__art svg { max-width: 100%; height: auto; }

.preview__fields {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr;
  gap: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin: 0;
  min-width: 0;
}

.preview__fields dt { color: var(--text-muted); }

.preview__fields dd {
  color: var(--text-secondary);
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.preview__fields dd a { color: var(--accent-bright); }

/* ── the recognition picker (send.html) ────────────────────────── */

.badge-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.sphere__title {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
}

.sphere__options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--space-3);
}

.badge-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  font: inherit;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: background var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}

.badge-option:hover { background: var(--surface-2); }

.badge-option[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--surface-2);
}

.badge-option__name {
  color: var(--text-primary);
  font-weight: 600;
  font-size: var(--text-sm);
}

.badge-option__desc {
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 1.5;
}
