/* avatar-modal.css — profile picture cropper.
   Scoped under .av-* so it can never bleed into other surfaces. */

.av-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 41, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 10050;
  animation: avFadeIn .12s ease-out;
}
@keyframes avFadeIn { from { opacity: 0 } to { opacity: 1 } }

.av-modal {
  background: white;
  border-radius: 14px;
  padding: 18px 22px 20px;
  width: 380px; max-width: 92vw;
  box-shadow: 0 24px 64px rgba(15, 23, 41, .32);
  animation: avPop .14s ease-out;
}
@keyframes avPop {
  from { transform: scale(.96); opacity: 0 }
  to   { transform: scale(1);    opacity: 1 }
}

.av-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.av-modal-head h3 {
  margin: 0; font-size: 15px; font-weight: 700; color: #0f1729;
  letter-spacing: -0.01em;
}
.av-close {
  background: transparent; border: 0;
  font-size: 22px; line-height: 1; color: #676879;
  cursor: pointer; padding: 2px 8px; border-radius: 6px;
}
.av-close:hover { background: #f5f6f8; color: #0f1729; }

/* ── Pick stage ───────────────────────────────────────────────── */
.av-pick {
  display: flex; flex-direction: column; gap: 14px;
}
.av-pick-empty {
  font-size: 13px; color: #676879; text-align: center;
  padding: 18px 12px 4px;
}

/* ── Crop stage ───────────────────────────────────────────────── */
.av-crop { display: flex; flex-direction: column; gap: 12px; }

.av-crop-wrap {
  display: flex; justify-content: center;
  padding: 4px 0 4px;
}
.av-viewport {
  position: relative; overflow: hidden;
  border-radius: 50%;
  background: #1a1f2e;
  cursor: grab;
  box-shadow: 0 0 0 4px white, 0 0 0 5px #e6e9ef,
              0 12px 32px rgba(15, 23, 41, .15);
  touch-action: none;
}
.av-viewport:active { cursor: grabbing; }
.av-viewport img { display: block; }

.av-zoom {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: #676879;
  padding: 2px 4px;
}
.av-zoom-label {
  font-weight: 600; flex-shrink: 0;
  color: #323338;
}
.av-zoom-val {
  font-variant-numeric: tabular-nums;
  min-width: 44px; text-align: right;
  color: #323338; font-weight: 600;
}
.av-zoom input[type="range"] {
  flex: 1;
  accent-color: var(--brand, #a25ddc);
}

.av-error {
  font-size: 12px; color: #b41f37;
  text-align: center;
  padding: 4px 8px;
}

.av-actions {
  display: flex; gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.av-btn {
  padding: 8px 14px; border-radius: 7px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  border: 1px solid #e6e9ef;
  background: white; color: #323338;
  transition: background .08s, border-color .08s;
}
.av-btn:hover { background: #f5f6f8; }
.av-btn:disabled { opacity: .55; cursor: progress; }

.av-primary {
  background: var(--brand, #a25ddc);
  color: white;
  border-color: transparent;
}
.av-primary:hover { filter: brightness(0.95); background: var(--brand, #a25ddc); }
.av-primary:disabled { background: var(--brand, #a25ddc); }

.av-danger {
  color: #b41f37;
  border-color: rgba(180, 31, 55, .18);
}
.av-danger:hover {
  background: rgba(180, 31, 55, .08);
  border-color: rgba(180, 31, 55, .28);
}
