/* ============================================================
   Signature maker (sign) - two-column layout
   ============================================================ */

.sign-tool {
  max-width: 1180px;
}

.sign-panels {
  align-items: flex-start;
}

.sign-input-panel,
.sign-output-panel {
  height: auto;
  min-width: 0;
}

.sign-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sign-status {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary, #6c757d);
  max-width: 58%;
  text-align: right;
}

.sign-status.text-danger {
  color: #b3261e;
}

.sign-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* ---- pen tools ---- */

.sign-tools-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color, #e3e6ea);
}

.sign-tool {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.sign-tool > span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary, #212529);
}

.sign-tool input[type="color"] {
  width: 44px;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--border-color, #c9ced6);
  border-radius: 6px;
  background: var(--surface, #fff);
  cursor: pointer;
}

.sign-size-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sign-size-row input[type="range"] {
  width: 130px;
  accent-color: var(--brand, #0a58ca);
}

.sign-size-value {
  min-width: 22px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #212529);
}

.sign-bg-options,
.sign-format-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sign-bg-options .custom-option,
.sign-format-options .custom-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border-color, #c9ced6);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
}

.sign-bg-options .custom-option:hover,
.sign-format-options .custom-option:hover {
  border-color: var(--brand, #0a58ca);
}

.sign-bg-options input:checked + span,
.sign-format-options input:checked + span {
  color: var(--brand, #0a58ca);
  font-weight: 600;
}

/* ---- canvas ---- */

.sign-canvas-wrap {
  position: relative;
  width: 100%;
  border: 1px dashed var(--border-color, #c9ced6);
  border-radius: 8px;
  background: var(--surface, #fff);
  overflow: hidden;
  touch-action: none;
}

.sign-canvas {
  display: block;
  width: 100%;
  height: 220px;
  cursor: crosshair;
  background: transparent;
}

.sign-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary, #9aa0a8);
  pointer-events: none;
  text-align: center;
}

.sign-placeholder i {
  font-size: 34px;
  margin-bottom: 10px;
}

.sign-placeholder p {
  margin: 0;
  font-size: 13px;
}

.sign-placeholder.hidden {
  display: none;
}

.sign-action-row {
  display: flex;
  gap: 10px;
}

.sign-action-row .btn {
  min-width: 110px;
  justify-content: center;
}

/* ---- output ---- */

.sign-output-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sign-output-actions .btn[disabled],
.sign-output-actions .btn[disabled]:hover {
  opacity: 0.5;
  cursor: not-allowed;
}

.sign-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  border: 1px solid var(--border-color, #e3e6ea);
  border-radius: 8px;
  background: var(--surface, #fff);
  padding: 14px;
  overflow: auto;
}

.sign-preview-ph {
  text-align: center;
  color: var(--text-secondary, #6c757d);
}

.sign-preview-ph i {
  font-size: 38px;
  display: block;
  margin-bottom: 10px;
}

.sign-preview-ph p {
  margin: 0;
  font-size: 13px;
}

.sign-preview-img {
  max-width: 100%;
  max-height: 260px;
  height: auto;
  display: block;
}

.sign-preview-img.hidden {
  display: none;
}

.sign-preview-svg {
  max-width: 100%;
}

.sign-preview-svg svg {
  max-width: 100%;
  height: auto;
  display: block;
  background: repeating-conic-gradient(#f2f3f5 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
}

.sign-preview-svg.hidden {
  display: none;
}

.sign-svg-code {
  width: 100%;
  min-height: 140px;
  font-family: Consolas, Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #e3e6ea);
  border-radius: 6px;
  background: var(--code-bg, #f8f9fa);
  color: var(--text-primary, #212529);
  resize: vertical;
}

.sign-svg-code.hidden {
  display: none;
}

.sign-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sign-meta {
  font-size: 11.5px;
  color: var(--text-secondary, #6c757d);
  background: rgba(108, 117, 125, 0.08);
  border-radius: 4px;
  padding: 4px 8px;
}

.sign-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary, #6c757d);
}

.sign-note i {
  margin-top: 2px;
}

/* ---- mobile ---- */

@media (max-width: 767px) {
  .sign-status {
    max-width: 100%;
    text-align: left;
  }

  .sign-canvas {
    height: 190px;
  }

  .sign-action-row .btn {
    flex: 1 1 45%;
  }

  .sign-preview-wrap {
    min-height: 170px;
  }
}
