/* ============================================================
   avatar-crop.css — หน้าต่างครอปรูปโปรไฟล์ (ใช้กับ js/avatar-crop.js)
   ธีมเดียวกับระบบ: น้ำเงิน #2563eb · การ์ดมนใหญ่ · ปุ่มแคปซูล
   ============================================================ */
body.uxc-open { overflow: hidden; }

.uxc {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(10, 20, 40, .72);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.uxc[hidden] { display: none !important; }

.uxc__box {
    width: 100%;
    max-width: 380px;
    padding: 18px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(8, 20, 45, .35);
    text-align: center;
}
.uxc__head { margin-bottom: 14px; }
.uxc__head b {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: #16233a;
}
.uxc__head span {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.55;
    color: #64748b;
}

/* เวทีครอป — เป็นจัตุรัสเสมอ */
.uxc__stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 18px;
    background: #0f172a;
    touch-action: none;
    cursor: grab;
}
.uxc__stage:active { cursor: grabbing; }
.uxc__stage img {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    user-select: none;
    -webkit-user-drag: none;
}
.uxc__mask {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
/* วงกลมบอกขอบเขตที่จะถูกใช้จริง (ไฟล์ที่ได้เป็นจัตุรัส) */
.uxc__hole {
    position: absolute;
    inset: 12px;
    border: 2px dashed rgba(255, 255, 255, .9);
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(8, 20, 45, .55);
}

.uxc__zoom {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 4px 0;
    color: #64748b;
}
.uxc__zoom svg { width: 17px; height: 17px; flex: 0 0 17px; }
.uxc__zoom input[type="range"] {
    flex: 1;
    accent-color: #2563eb;
}

.uxc__foot {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}
.uxc__btn {
    flex: 1 1 0;
    min-height: 46px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #fff;
    color: #475467;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.uxc__btn:hover { background: #f6f9ff; }
.uxc__btn--go {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}
.uxc__btn--go:hover { background: #1d4ed8; }

/* ป้ายบอกว่ารูปถูกครอปแล้ว รอกดบันทึก */
.surin-avatar-upload .uxc-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 5px 11px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #f0fdf4;
    color: #15803d;
    font-size: 12px;
    font-weight: 600;
}

@media screen and (max-width: 480px) {
    .uxc { padding: 12px; }
    .uxc__box { padding: 15px; border-radius: 20px; }
    .uxc__head b { font-size: 16px; }
}
