/* Hermes additions to the cosmos-ui theme. Tokens come from theme.css. */

/* Views and notices are toggled with the hidden attribute; keep it winning
   over any display rule below. */
[hidden] {
  display: none !important;
}

.cosmos-main {
  max-width: 44rem;
  margin: 0 auto;
}

.hermes-label {
  display: block;
  margin: 1rem 0 0.35rem;
  font-weight: 600;
}

textarea,
input[type="text"],
input[type="password"],
input[type="email"],
select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: var(--text);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

textarea:focus,
input:focus,
select:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.hermes-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.hermes-row input {
  flex: 1;
  min-width: 0;
}

.hermes-hint {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hermes-over {
  color: var(--danger);
  font-weight: 600;
}

.hermes-check {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 1rem 0;
}

.hermes-fieldset {
  margin: 1rem 0;
  padding: 0 1rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.hermes-fieldset legend {
  padding: 0 0.35rem;
  color: var(--text-muted);
}

.hermes-alert {
  margin: 1rem 0;
  padding: 0.7rem 0.9rem;
  color: var(--danger);
  background: var(--surface-alt);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
}

.hermes-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.hermes-btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.hermes-btn-danger {
  background: var(--danger);
  color: var(--brand-contrast);
}

form > button[type="submit"] {
  margin-top: 1rem;
}

.cosmos-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

a.cosmos-btn {
  text-decoration: none;
}

.hermes-message {
  margin: 1rem 0 0;
  padding: 1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

dialog {
  max-width: 28rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

@media (max-width: 480px) {
  .hermes-row {
    flex-wrap: wrap;
  }
}
