/* Container tổng */
.sign-status-wrapper {
    max-width: 600px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.status-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border: 1px solid #e1e1e1;
    text-align: center;
}

.status-box h3 {
    margin-top: 0;
    color: #1d2327;
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.status-box p {
    color: #646970;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* Khu vực Canvas */
.canvas-wrapper {
    position: relative;
    margin-bottom: 20px;
    background: #fcfcfc;
    border: 2px dashed #dcdcde;
    border-radius: 8px;
    transition: border-color 0.3s ease;
}

.canvas-wrapper:hover {
    border-color: #2271b1;
}

#sig-canvas {
    display: block;
    width: 100%;
    height: auto;
    touch-action: none;
    /* Quan trọng cho mobile */
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 19l7-7 3 3-7 7-3-3z"></path><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"></path><path d="M2 2l5 5"></path></svg>'), crosshair;
}

/* Các nút bấm */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.form-actions button {
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

/* Nút Gửi */
button[type="submit"] {
    background-color: #2271b1;
    color: white;
}

button[type="submit"]:hover {
    background-color: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(34, 113, 177, 0.2);
}

/* Nút Xóa */
#sig-clear {
    background-color: #f6f7f7;
    color: #d63638;
    border: 1px solid #d63638;
}

#sig-clear:hover {
    background-color: #d63638;
    color: white;
}


.pdf-viewer-wrapper {
    text-align: center;
}

.canvas-wrapper {
    text-align: center;
    /* Căn giữa tờ giấy */
    background: #525659;
    padding: 20px 0;
}

#target-sign-box {
    position: absolute;
    border: 2px dashed red;
    background: rgba(255, 0, 0, 0.2);
    z-index: 10;
    display: none;
    pointer-events: none;
}

/* Css cho khu vực shortcode */
/* Overlay chờ xử lý */
#signing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.spinner-signing {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Các style cũ */
.pdf-viewer-wrapper {
    position: relative;
    background: #525659;
    border: 2px solid #333;
    margin-bottom: 20px;
    text-align: center;
}

.canvas-container {
    position: relative;
    display: inline-block;
    margin: 20px auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

#pdf-render-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    z-index: 1;
}

#user-drag-signature {
    position: absolute;
    z-index: 100;
    cursor: move;
    border: 2px dashed #2271b1;
    background: rgba(34, 113, 177, 0.1);
    display: none;
    width: 150px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#sig-preview-img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}

.drag-label {
    background: #2271b1;
    color: #fff;
    font-size: 9px;
    padding: 2px;
    text-align: center;
    font-weight: bold;
    pointer-events: none;
}

#resizer {
    width: 16px;
    height: 16px;
    background: #2271b1;
    position: absolute;
    right: -8px;
    bottom: -8px;
    cursor: nwse-resize;
    border-radius: 50%;
    border: 2px solid white;
    z-index: 101;
}

.sign-status-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

#sig-canvas {
    border: 2px solid #ccc;
    background: #fff;
    width: 100%;
    border-radius: 8px;
    cursor: crosshair;
}

.form-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-primary {
    background: #2271b1;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-secondary {
    background: #f6f7f7;
    color: #d63638;
    border: 1px solid #d63638;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.notice-box {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
}

.notice-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

.notice-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}