/* Tumalano application styles. Bootstrap provides the base. */
:root {
  --tm-auth-max-width: 28rem;
}

.tm-auth-card {
  max-width: var(--tm-auth-max-width);
  margin-inline: auto;
}

.tm-auth-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.tm-auth-card textarea,
.tm-auth-card select {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: var(--bs-border-width) solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
}

.tm-auth-card input:focus,
.tm-auth-card textarea:focus,
.tm-auth-card select:focus {
  outline: 0;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.tm-auth-card .errorlist {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  color: var(--bs-danger-text-emphasis);
}

/* PDF preview */
.tm-pdf-pages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tm-pdf-page {
  width: 100%;
  background: #fff;
  border: var(--bs-border-width) solid var(--bs-border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
}

.tm-pdf-page canvas {
  width: 100%;
  height: auto;
  display: block;
}

.tm-mode-option {
  cursor: pointer;
}

.tm-mode-option:has(input:checked) {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.25);
}

.tm-hash {
  font-family: var(--bs-font-monospace);
  font-size: 0.75rem;
  word-break: break-all;
}

/* Field placement editor */
.tm-editor-toolbar {
  position: sticky;
  top: 1rem;
}

.tm-editor-pages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tm-editor-page {
  position: relative;
  border: var(--bs-border-width) solid var(--bs-border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  background: #fff;
  cursor: crosshair;
  user-select: none;
  touch-action: none;
}

.tm-editor-page canvas {
  display: block;
  width: 100%;
  height: auto;
}

.tm-editor-page-label {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.85);
  padding: 0 0.25rem;
  border-radius: 0.2rem;
}

.tm-field {
  position: absolute;
  border: 2px solid var(--tm-field-color, #0d6efd);
  background: color-mix(in srgb, var(--tm-field-color, #0d6efd) 15%, transparent);
  font-size: 0.7rem;
  line-height: 1.1;
  padding: 1px 3px;
  overflow: hidden;
  cursor: move;
  color: #111;
}

.tm-field.is-selected {
  outline: 2px dashed #111;
  outline-offset: 1px;
}

.tm-field-handle {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  background: var(--tm-field-color, #0d6efd);
  cursor: nwse-resize;
}

.tm-editor-list li {
  margin-bottom: 0.25rem;
}

/* Preserve the line breaks people typed (declarations, messages). */
.tm-pre-line {
  white-space: pre-line;
}
