/* MotionGIF - Crop GIF page styles.
   Loaded after site.css; uses the same design tokens. All classes are
   prefixed mgcr- so nothing collides with the shared stylesheet. */

.mgcr-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 22px 18px;
  text-align: center;
  margin-top: 20px;
}
.mgcr-dropzone.mgcr-over { border-color: var(--accent); background: var(--accent-soft); }
.mgcr-dropzone p { margin: 6px auto; color: var(--muted); }
.mgcr-dropzone .mgcr-big { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0 auto; }
.mgcr-file-input { display: none; }

.mgcr-facts {
  background: var(--accent-soft);
  border: 1px solid #c3d3e6;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 16px;
  font-size: 15px;
}
.mgcr-facts p { margin: 4px 0; }
.mgcr-facts .mgcr-fname { font-weight: 700; word-break: break-all; }

.mgcr-modes { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.mgcr-aspect-btn, .mgcr-preset-btn {
  min-height: 44px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.mgcr-aspect-btn[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.mgcr-preset-btn:hover, .mgcr-aspect-btn:hover { border-color: var(--accent); }

.mgcr-num {
  width: 100%; min-height: 44px; padding: 10px 12px; font-size: 16px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-family: inherit;
}
.mgcr-error { color: #b91c1c; font-size: 14px; margin: 6px 0 0; }
.mgcr-readout {
  border-radius: var(--radius); padding: 12px 16px; margin: 16px 0 0;
  font-size: 15px; border: 1px solid var(--border); background: var(--surface);
}
.mgcr-readout p { margin: 4px 0; }
.mgcr-note-ok { border-color: #a7f3d0; background: #ecfdf5; }
.mgcr-note-warn { border-color: #fcd34d; background: #fffbeb; }

.mgcr-limits {
  font-size: 14px; color: var(--muted);
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 10px 14px; margin-top: 16px;
}
.mgcr-limits p { margin: 4px 0; }
.mgcr-limits strong { color: var(--ink); }

/* Stage: the playing original with the crop box over it */
.mgcr-stage-wrap {
  position: relative; line-height: 0; max-width: 100%;
  touch-action: none;
}
.mgcr-stage-wrap canvas { display: block; }
.mgcr-box {
  position: absolute; box-sizing: border-box;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.45);
  cursor: move;
}
.mgcr-handle {
  position: absolute; width: 18px; height: 18px; box-sizing: border-box;
  background: var(--surface); border: 2px solid var(--accent);
  border-radius: 5px;
}
.mgcr-handle[data-handle="nw"] { left: -10px; top: -10px; cursor: nwse-resize; }
.mgcr-handle[data-handle="ne"] { right: -10px; top: -10px; cursor: nesw-resize; }
.mgcr-handle[data-handle="sw"] { left: -10px; bottom: -10px; cursor: nesw-resize; }
.mgcr-handle[data-handle="se"] { right: -10px; bottom: -10px; cursor: nwse-resize; }

.mgcr-stepper {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px;
}
.mgcr-step-btn {
  min-height: 44px; padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.mgcr-step-btn:hover { border-color: var(--accent); }

.mgcr-result-stage {
  display: flex; justify-content: center; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  overflow: hidden; margin-top: 14px;
}
