/* Universal image field (Phase 397) — resources/views/components/image-field.blade.php */
.imgf { display: grid; gap: .55rem; min-width: 0; container-type: inline-size; }
.imgf__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.imgf__badge { font-size: .72rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; background: rgba(37, 99, 235, .08); color: #1d4ed8; }
.imgf__hint { font-size: .8rem; line-height: 1.45; color: #4b5563; }
.imgf__current { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.imgf__current-img { max-width: min(100%, 260px); max-height: 160px; width: auto; height: auto; object-fit: contain; border-radius: 8px; border: 1px solid rgba(0, 0, 0, .08); background: repeating-conic-gradient(#f1f5f9 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.imgf__current-img--circle { border-radius: 50%; max-height: 120px; aspect-ratio: 1 / 1 !important; object-fit: cover; }
.imgf__current-meta { display: flex; flex-direction: column; gap: .2rem; font-size: .78rem; color: #64748b; align-items: flex-start; }
.imgf__current--replaced { opacity: .45; }
.imgf__status { font-size: .8rem; line-height: 1.45; padding: .45rem .7rem; border-radius: 8px; border-left: 4px solid; overflow-wrap: anywhere; }
.imgf__status--green { background: #ecfdf5; border-color: #10b981; color: #065f46; }
.imgf__status--amber { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
.imgf__status--red { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
.imgf__editor { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: .8rem; align-items: start; }
.imgf__editor[hidden] { display: none; }
.imgf__stage { min-width: 0; height: clamp(220px, 42vh, 380px); background: #0f172a; border-radius: 10px; overflow: hidden; }
.imgf__stage img { display: block; max-width: 100%; }
.imgf__side { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.imgf__preview { width: 100%; overflow: hidden; border-radius: 8px; background: #e2e8f0; border: 1px solid rgba(0, 0, 0, .08); }
.imgf__preview--circle { border-radius: 50%; }
.imgf__preview-label { font-size: .72rem; color: #64748b; text-align: center; }
.imgf__tools { display: flex; flex-wrap: wrap; gap: .25rem; }
.imgf__tools .btn { min-width: 2.1rem; padding: .25rem .45rem; font-size: .85rem; line-height: 1.2; }
.imgf__meta { padding-top: .2rem; }
/* Stack when the field itself is narrow (a half-width card), not only on small screens —
   side by side, the crop area shrank to a strip. */
@container (max-width: 560px) {
  .imgf__editor { grid-template-columns: 1fr; }
  .imgf__side { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: .5rem .75rem; align-items: start; }
  .imgf__preview { width: 120px; grid-row: span 2; }
  .imgf__preview-label { display: none; }
  .imgf__meta .col-md-6 { flex: 0 0 100%; max-width: 100%; }
}
[data-bs-theme="dark"] .imgf__status--green { background: rgba(16, 185, 129, .12); color: #a7f3d0; }
[data-bs-theme="dark"] .imgf__status--amber { background: rgba(245, 158, 11, .12); color: #fde68a; }
[data-bs-theme="dark"] .imgf__status--red { background: rgba(239, 68, 68, .12); color: #fecaca; }
/* Fallback for pages without the admin / Advance "btn-ghost" (member portal, classic pages).
   :where() keeps it at zero specificity, so a theme that defines btn-ghost wins. */
:where(.imgf .btn-ghost) { border: 1px solid rgba(15, 23, 42, .15); background: #fff; color: #334155; }
:where(.imgf .btn-ghost:hover) { background: #f1f5f9; }
/* Focus point picker (Phase 399) */
.imgf__focus { position: relative; display: inline-block; cursor: crosshair; line-height: 0; max-width: min(100%, 260px); }
.imgf__focus .imgf__current-img { max-width: 100%; }
.imgf__focus-dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 3px solid #fff;
  background: rgba(37, 99, 235, .85); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .35); pointer-events: none; }
.imgf__focus-help { max-width: 22ch; line-height: 1.35; }
[data-bs-theme="dark"] .imgf__hint, [data-bs-theme="dark"] .imgf__current-meta, [data-bs-theme="dark"] .imgf__preview-label { color: #b6c0ba; }
[data-bs-theme="dark"] .imgf__badge { color: #bfdbfe; background: rgba(59, 130, 246, .2); }

/* Phase 425: compact variant (ID card / letter templates) — current image beside the file picker. */
.imgf__row { display: grid; gap: .55rem; min-width: 0; }
.imgf--compact { gap: .4rem; }
.imgf--compact .imgf__hint { font-size: .76rem; color: #64748b; }
.imgf--compact .imgf__row { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.imgf--compact .imgf__row > .imgf__current.d-none + .imgf__input { grid-column: 1 / -1; }
.imgf--compact .imgf__current { flex-wrap: nowrap; gap: .5rem; }
.imgf--compact .imgf__current-img { max-width: 150px; max-height: 56px; border-radius: 6px; }
.imgf--compact .imgf__current-img--circle { max-height: 56px; }
.imgf--compact .imgf__current-meta > span:first-child { display: none; }
@container (max-width: 360px) { .imgf--compact .imgf__row { grid-template-columns: minmax(0, 1fr); } }
/* Same thumbnail column on every compact field, so the file pickers line up. */
.imgf--compact .imgf__row { grid-template-columns: 150px minmax(0, 1fr); }
.imgf--compact .imgf__current-img { margin-inline: auto; }
@container (max-width: 360px) { .imgf--compact .imgf__row { grid-template-columns: minmax(0, 1fr); } }
.imgf--compact .imgf__current { flex-direction: column; align-items: center; gap: .25rem; min-width: 0; }
.imgf--compact .imgf__current-meta { align-items: center; font-size: .72rem; }
