/* Explain: Styles for the image cropping modal used in admin forms. */
/* Jendela pengaturan foto (potong dan sesuaikan) pada panel petugas desa.
   Dipakai saat petugas mengunggah foto pada menu Kelembagaan Desa, yaitu foto
   lembaga beserta foto pengurus PKK, LPMD, RT, RW, Linmas, dan Posyandu.
   Foto ditempatkan di dalam kotak persegi yang dapat digeser dan diperbesar,
   sehingga hasil unggahan tampil rapi dan tidak terpotong di halaman publik. */
.acrop-modal {
    width: min(30rem, calc(100vw - 1.6rem));
    max-width: none;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    border: 0;
    border-radius: 1.5rem;
    padding: 0;
    background: transparent;
    color: var(--text-color);
    font-family: var(--font-body);
}

.acrop-modal::backdrop {
    background: color-mix(in srgb, var(--charcoal-color) 58%, transparent);
}

.acrop-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    background: var(--surface-color);
    padding: 1rem;
    box-shadow: var(--shadow-soft);
}

.acrop-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.acrop-eyebrow {
    margin: 0;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--primary-color);
}

.acrop-title {
    margin: 0.2rem 0 0;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--charcoal-color);
}

.acrop-hint {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--text-muted);
}

.acrop-close {
    display: inline-flex;
    height: 2.2rem;
    width: 2.2rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface-color);
    color: var(--charcoal-color);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 300ms ease, color 300ms ease;
}

.acrop-close:hover {
    background: var(--secondary-color);
}

.acrop-stage {
    position: relative;
    width: 100%;
    max-width: min(22rem, 92%);
    max-height: 52vh;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 1rem;
    background: color-mix(in srgb, var(--charcoal-color) 88%, transparent);
    touch-action: none;
    cursor: grab;
}

.acrop-stage.is-dragging {
    cursor: grabbing;
}

.acrop-stage,
.acrop-stage * {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.acrop-image {
    position: absolute;
    left: 50%;
    top: 50%;
    max-width: none;
    max-height: none;
    transform: translate(-50%, -50%);
    transform-origin: center;
    pointer-events: none;
}

/* Penanda area potongan: garis tepi putih dan garis bantu sepertiga agar
   petugas mudah menempatkan bagian terpenting foto di tengah kotak. */
.acrop-frame {
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--surface-color) 92%, transparent);
    background-image:
        linear-gradient(to right, color-mix(in srgb, var(--surface-color) 34%, transparent) 1px, transparent 1px),
        linear-gradient(to bottom, color-mix(in srgb, var(--surface-color) 34%, transparent) 1px, transparent 1px);
    background-size: 33.333% 33.333%;
    background-position: center;
}

.acrop-zoom {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.acrop-zoom-label {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.acrop-range {
    width: 100%;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.acrop-status {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--text-muted);
}

.acrop-status:empty {
    display: none;
}

.acrop-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.acrop-btn {
    display: inline-flex;
    min-height: 2.75rem;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface-color);
    padding: 0 1.1rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 900;
    color: var(--charcoal-color);
    cursor: pointer;
    transition: background 300ms ease, color 300ms ease, border-color 300ms ease;
}

.acrop-btn:hover {
    border-color: color-mix(in srgb, var(--primary-color) 50%, transparent);
    background: color-mix(in srgb, var(--primary-color) 8%, var(--surface-color));
}

.acrop-btn.is-primary {
    border-color: transparent;
    background: var(--primary-color);
    color: var(--cream-color);
}

.acrop-btn.is-primary:hover {
    background: var(--primary-hover);
}

.acrop-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .acrop-btn {
        flex: 1 1 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .acrop-close,
    .acrop-btn {
        transition: none;
    }
}