/* =============================================================
   RCT Check-In — Photo Editor
   Full-screen, mobile-first, touch-driven.
============================================================= */

.rpe-overlay {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
}

.rpe-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .6);
}

.rpe-box {
  position: relative;
  display: flex; flex-direction: column;
  width: 100%; height: 100%;
  background: #fff;
  overflow: hidden;
}

@media (min-width: 640px) {
  .rpe-box {
    width: 92vw; height: 90vh;
    max-width: 520px;
    border-radius: 10px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, .3);
  }
}

.rpe-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: #1d2327; color: #fff;
  flex-shrink: 0;
}

.rpe-title { font-size: 15px; font-weight: 700; }

.rpe-close {
  min-width: 40px; min-height: 40px;
  border: none; background: transparent; color: #fff;
  font-size: 16px; cursor: pointer; border-radius: 4px;
}
.rpe-close:hover { background: rgba(255, 255, 255, .15); }

.rpe-body {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column;
}

.rpe-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid #dcdcde;
  flex-shrink: 0;
  background: #fff;
}

.rpe-btn {
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid #2271b1;
  border-radius: 6px;
  background: #fff;
  color: #2271b1;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
}

.rpe-btn--primary { background: #2271b1; color: #fff; }
.rpe-btn--big { width: 100%; font-size: 16px; padding: 14px 18px; }

.rpe-hint { color: #50575e; font-size: 13px; line-height: 1.5; margin: 0 0 12px; }
.rpe-error { color: #d63638; font-size: 13px; }
.rpe-status { color: #50575e; font-size: 13px; align-self: center; }

/* ---------- Capture ---------- */
.rpe-capture {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; text-align: center;
}
.rpe-file-input { display: none; }

/* ---------- Crop ---------- */
.rpe-crop-wrap { flex: 1; min-height: 55vh; }
.rpe-crop-img { display: block; max-width: 100%; }

/* ---------- Adjust ---------- */
.rpe-adjust-wrap { display: flex; flex-direction: column; gap: 14px; }
.rpe-adjust-canvas {
  width: 100%; height: auto;
  border: 1px solid #dcdcde; border-radius: 6px;
  background: #000;
}

.rpe-controls { display: flex; flex-direction: column; gap: 12px; }
.rpe-control {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; font-weight: 600; color: #50575e;
  text-transform: uppercase; letter-spacing: .3px;
}
.rpe-control input[type="range"] { width: 100%; height: 32px; }
.rpe-control--inline { flex-direction: row; align-items: center; gap: 10px; }
.rpe-control--inline input[type="color"] { width: 44px; height: 32px; border: 1px solid #dcdcde; border-radius: 4px; padding: 2px; }

/* ---------- Logo placement ---------- */
.rpe-logo-stage-wrap { display: flex; flex-direction: column; gap: 10px; }

.rpe-logo-stage {
  position: relative;
  width: 100%;
  border: 1px solid #dcdcde; border-radius: 6px;
  overflow: hidden;
  background: #000;
  touch-action: none;
}

.rpe-logo-stage .rpe-adjust-canvas {
  display: block; width: 100%; height: auto;
  border: none; border-radius: 0;
  pointer-events: none;
}

.rpe-logo {
  position: absolute;
  touch-action: none;
  cursor: grab;
  border: 2px dashed rgba(255, 255, 255, .85);
  box-sizing: border-box;
}
.rpe-logo:active { cursor: grabbing; }

.rpe-logo-img {
  width: 100%; height: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
}

.rpe-logo-handle {
  position: absolute;
  right: -12px; bottom: -12px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #2271b1;
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  touch-action: none;
  cursor: nwse-resize;
}

/* ---------- Finalizing ---------- */
.rpe-finalizing {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; color: #50575e;
}
.rpe-spinner {
  width: 34px; height: 34px;
  border: 3px solid #ddd; border-top-color: #2271b1;
  border-radius: 50%; animation: rpe-spin .7s linear infinite;
}
@keyframes rpe-spin { to { transform: rotate(360deg); } }
