/* ── Avatar wrapper ─────────────────────────────────────── */
.avatar-upload-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
  border-radius: 50%;
  overflow: hidden; /* clips <img> to a perfect circle */
}

.avatar-upload-wrap .avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.25s ease,
    opacity 0.25s ease;
  opacity: 0;
}

.avatar-upload-wrap:hover .avatar-overlay {
  background: rgba(0, 0, 0, 0.5);
  opacity: 1;
}

.avatar-upload-wrap .avatar-overlay i {
  color: #fff;
  font-size: 1.1rem;
}

/* ── Dropzone ───────────────────────────────────────────── */
.photo-dropzone {
  border: 2px dashed #ced4da;
  border-radius: 0.75rem;
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
  user-select: none;
}

.photo-dropzone:hover,
.photo-dropzone.drag-over {
  border-color: var(--bs-primary, #0d6efd);
  background: rgba(13, 110, 253, 0.04);
}

.photo-dropzone .dropzone-icon {
  font-size: 2.5rem;
  color: var(--bs-primary, #0d6efd);
  opacity: 0.6;
  line-height: 1;
}

/* ── Cropper area ───────────────────────────────────────── */
#cropperArea {
  min-height: 300px;
}

.cropper-wrapper {
  max-height: 380px;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #1a1a1a;
}

.cropper-wrapper img {
  display: block;
  max-width: 100%;
}

/* ── Preset buttons ─────────────────────────────────────── */
.photo-preset-btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  border: 1px solid #ced4da;
  background: transparent;
  color: #6c757d;
  transition: all 0.15s;
  cursor: pointer;
}

.photo-preset-btn.active,
.photo-preset-btn:hover {
  background: var(--bs-primary, #0d6efd);
  border-color: var(--bs-primary, #0d6efd);
  color: #fff;
}

/* ── Cropper toolbar buttons ────────────────────────────── */
.crop-tool-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

/* ── Shared preview wrapper ──────────────────────────────── */
.attachment-preview-wrap {
  width: 150px;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Wider variant for the signature (landscape) */
.attachment-preview-wrap--wide {
  width: 240px;
  min-height: 100px;
}

/* Empty state placeholder */
.attachment-empty-state {
  width: 100%;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed #dee2e6;
  border-radius: 0.5rem;
  padding: 1rem;
  color: #adb5bd;
  font-size: 2rem;
}

/* Passport photo preview — fixed portrait ratio */
.attachment-preview-img {
  width: 150px;
  height: 190px; /* approx 35:45 ratio */
  object-fit: cover;
  border-radius: 0.25rem;
}

/* Signature preview — landscape */
.attachment-preview-img--sign {
  width: 240px;
  height: 100px;
  object-fit: contain; /* don't crop signature */
  background: #fff;
}
