/* Container tổng */
.sign-submit-wrapper {
    max-width: 800px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* PDF Viewer & Navigation */
.pdf-viewer-wrapper {
    background: #525659;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.pdf-nav {
    user-select: none;
}

.canvas-container {
    padding: 20px;
    background: #8e9194;
    display: flex;
    justify-content: center;
    position: relative;
    min-height: 300px;
}

#pdf-render-canvas {
    background: #fff;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    max-width: 100%;
    height: auto !important;
}

.canvas-wrapper {
    max-width: 100%;
}

/* Overlay Canvas for Signing */
#sig-overlay-canvas {
    transition: opacity 0.3s;
    max-width: 100%;
    height: auto !important;
}

#sig-overlay-canvas.locked {
    pointer-events: none;
    opacity: 0.7;
}

/* Bounding Box Indicator */
#sig-bounding-box {
    box-shadow: 0 0 10px rgba(70, 180, 80, 0.4);
    background: rgba(70, 180, 80, 0.05);
}

/* Buttons */
.btn-nav {
    background: #fff;
    border: 1px solid #dee2e6;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-primary {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary {
    background: #fff;
    color: #d63638;
    border: 1px solid #d63638;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary-finish {
    background: linear-gradient(135deg, #46b450 0%, #358e3c 100%);
    color: #fff;
    border: none;
    padding: 15px 45px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(70, 180, 80, 0.3);
    transition: transform 0.2s;
}

.btn-primary-finish:hover {
    transform: scale(1.05);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Status Notifications */
.notice-box {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
}

.notice-error { background: #fff2f0; border: 1px solid #ffccc7; color: #ff4d4f; }
.notice-success { background: #f6ffed; border: 1px solid #b7eb8f; color: #52c41a; }

/* Spinner & Overlay */
.notice-box {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    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;
}

@media (max-width: 768px) {
    .canvas-container {
        padding: 5px;
    }
    
    .nav-controls {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    
    .action-controls {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        margin-top: 10px;
    }
    
    .action-controls button {
        width: 100%;
    }
    
    .pdf-nav {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        padding: 10px !important;
    }
    
    #signing-hint {
        margin-left: 0 !important;
        text-align: center;
    }
}