html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ---- Issue #3 M2: contract signature-field editor ---- */
.wd-fe-body {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.wd-fe-pages {
  flex: 1 1 auto;
  min-width: 0;
  background: #f1f3f5;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 1rem;
  overflow: auto;
  max-height: 80vh;
}

.wd-fe-inspector {
  flex: 0 0 220px;
  position: sticky;
  top: 1rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 0.75rem;
  background: #fff;
}

.wd-fe-page {
  position: relative;
  margin: 0 auto 1rem auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  background: #fff;
  width: max-content;
}

.wd-fe-page canvas {
  display: block;
}

.wd-fe-overlay {
  position: absolute;
  inset: 0;
}

.wd-fe-field {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #0d6efd;
  background: rgba(13, 110, 253, 0.12);
  cursor: move;
  font-size: 11px;
  line-height: 1.1;
  color: #0d3d80;
  overflow: hidden;
  user-select: none;
}

.wd-fe-field[data-type="2"] { border-color: #198754; background: rgba(25, 135, 84, 0.12); color: #0f5132; }
.wd-fe-field[data-type="3"] { border-color: #b8860b; background: rgba(184, 134, 11, 0.14); color: #6b4e00; }

.wd-fe-field.is-selected {
  outline: 2px dashed #212529;
  outline-offset: 1px;
}

.wd-fe-field-label {
  padding: 1px 3px;
  pointer-events: none;
  font-weight: 600;
  white-space: nowrap;
}

.wd-fe-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #212529;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: nwse-resize;
}

.wd-fe[data-readonly="1"] .wd-fe-field { cursor: default; }
.wd-fe[data-readonly="1"] .wd-fe-handle { display: none; }